Today — the five fixtures are three crossterm programs (hello-tui, form-echo, resize-echo) and two std-only printers (image-echo, unicode-torture). None is a ratatui application. Measured against 0.9.0: ratatui appears nowhere in the workspace, and the README names TestBackend only in the comparison table's one row.
Why it is worth fixing — ratatui's testing recipe now sends readers here for "a small number of important user flows", and what those readers want to know is whether the screen termlens renders from their binary agrees with the screen TestBackend renders in-process. That agreement is also the sharpest regression test this crate can have for its own emulation layer: the same widget through two independent renderers, diffed cell by cell. Where they disagree, the bug is in the terminal layer — crossterm's encoding, the PTY, or termlens's emulation — which is precisely the layer nothing else tests. Today a ratatui reader arriving at fixtures/ finds nothing that looks like their application.
Fix — fixtures/ratatui-app: a small counter/list application (a List with a highlighted row, a status bar, a title carrying the counter) that brackets repaints in crossterm's BeginSynchronizedUpdate/EndSynchronizedUpdate, handles j/k/q and SIGWINCH, and hides nothing. Then tests/fidelity.rs:
let mut t = spawn_fixture("ratatui-app")?;
let frame = t.wait_frame(|s| s.contains("Counter: 0"))?;
let expected = render_with_test_backend(80, 24, State::default()); // the fixture's draw fn, in-process
assert!(frame.diff(&expected).is_empty(), "{}", frame.diff(&expected)); // #246
The fixture's draw function lives in a small library target so the test can call it against a TestBackend of the same size and turn the buffer into a Screen (a helper inside the test, not the crate). Styles are compared too — with_styles() on both — since a colour that survives TestBackend and not the PTY is exactly what this test exists to catch. Pin the ratatui version in the fixture's manifest the way crossterm is pinned in the workspace, and let Dependabot move it.
The README's comparison section gains a short list of what TestBackend structurally cannot see — raw-mode entry and exit, SIGWINCH, output printed outside ratatui, torn frames, capability probes, mouse and paste encodings under the enabled modes, conceal — each with the one-line termlens assertion that sees it, and a pointer to this fixture.
Done when — fixtures/ratatui-app exists and tests/fidelity.rs drives it; the fidelity test asserts the PTY-rendered frame equals the TestBackend-rendered buffer, cells and styles, at two sizes with a resize between; the README section lists what only a real PTY can catch, with the assertion for each; and it is what the README's ratatui readers are pointed at.
Today — the five fixtures are three crossterm programs (
hello-tui,form-echo,resize-echo) and two std-only printers (image-echo,unicode-torture). None is a ratatui application. Measured against 0.9.0:ratatuiappears nowhere in the workspace, and the README namesTestBackendonly in the comparison table's one row.Why it is worth fixing — ratatui's testing recipe now sends readers here for "a small number of important user flows", and what those readers want to know is whether the screen termlens renders from their binary agrees with the screen
TestBackendrenders in-process. That agreement is also the sharpest regression test this crate can have for its own emulation layer: the same widget through two independent renderers, diffed cell by cell. Where they disagree, the bug is in the terminal layer — crossterm's encoding, the PTY, or termlens's emulation — which is precisely the layer nothing else tests. Today a ratatui reader arriving atfixtures/finds nothing that looks like their application.Fix —
fixtures/ratatui-app: a small counter/list application (aListwith a highlighted row, a status bar, a title carrying the counter) that brackets repaints in crossterm'sBeginSynchronizedUpdate/EndSynchronizedUpdate, handlesj/k/qandSIGWINCH, and hides nothing. Thentests/fidelity.rs:The fixture's
drawfunction lives in a small library target so the test can call it against aTestBackendof the same size and turn the buffer into aScreen(a helper inside the test, not the crate). Styles are compared too —with_styles()on both — since a colour that survivesTestBackendand not the PTY is exactly what this test exists to catch. Pin the ratatui version in the fixture's manifest the waycrosstermis pinned in the workspace, and let Dependabot move it.The README's comparison section gains a short list of what
TestBackendstructurally cannot see — raw-mode entry and exit,SIGWINCH, output printed outside ratatui, torn frames, capability probes, mouse and paste encodings under the enabled modes, conceal — each with the one-line termlens assertion that sees it, and a pointer to this fixture.Done when —
fixtures/ratatui-appexists andtests/fidelity.rsdrives it; the fidelity test asserts the PTY-rendered frame equals theTestBackend-rendered buffer, cells and styles, at two sizes with a resize between; the README section lists what only a real PTY can catch, with the assertion for each; and it is what the README's ratatui readers are pointed at.