mosaic
mosaic copied to clipboard
Testing support
The counter example needs tests to show off how they work or would work.
One should start the rendering and assert 0, delay 250, and assert 1. The other should start the rendering and fast-forward to 20 and assert it exits cleanly and does not render anything else.
Seems blocked by #3 unless we go reeeeeally black box. Will try...
Generalizing this to simply be a testing framework for all programs built on Mosaic
Been thinking about this a bit and bouncing ideas off of folks.
I think we want two APIs:
- A
Turbine
-like harness which allows pulling frames which (by default) omit all ANSI escapes and instead return text-only "frames".- You could optionally turn on ANSI escapes, although it'll be very noisy.
- You can send events like input and resize
- A Paparazzi-like harness which allows capturing images of frames and comparing golden images against the running program.
- Need some kind of software-based renderer to avoid platform-specific rendering problems. Maybe libghostty once it's public, and presuming it includes an actual software renderer.
Another feature that might be interesting is rendering spaces with a middot (·). Probably better to fix rendering so we omit trailing spaces altogether though...