mosaic icon indicating copy to clipboard operation
mosaic copied to clipboard

Testing support

Open JakeWharton opened this issue 4 years ago • 4 comments

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.

JakeWharton avatar Nov 20 '20 04:11 JakeWharton

Seems blocked by #3 unless we go reeeeeally black box. Will try...

JakeWharton avatar Dec 16 '20 03:12 JakeWharton

Generalizing this to simply be a testing framework for all programs built on Mosaic

JakeWharton avatar Jun 05 '24 02:06 JakeWharton

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.

JakeWharton avatar Aug 13 '24 03:08 JakeWharton

Another feature that might be interesting is rendering spaces with a middot (·). Probably better to fix rendering so we omit trailing spaces altogether though...

JakeWharton avatar Aug 18 '24 03:08 JakeWharton