Skip to main content

Module testing

Module testing 

Source
Expand description

Headless test harness driving an App with synthetic input. Headless test harness driving an App with synthetic input.

Also home to conformance, the cross-backend harness that tests a raw Backend facet against its own trait contract.

TestHarness owns the drive-until-settled loop that a test would otherwise hand-roll around Headless (retroglyph#612): Headless supplies the backend and Headless::push_event, and the harness supplies everything between that and the assertion. Feature-gated (testing), no effect on release builds. Not a UI-testing framework: no assertions, no matchers, no fixtures, just the loop and the input synthesis that otherwise gets rewritten per consumer: push synthetic events onto Headless with push_event, drive them through an App with TestHarness until the loop settles, then assert on the resulting Headless frame directly.

conformance is a different tool for a different job: it drives a backend directly (no App, no Terminal) through the obligations Output, Cursor, and Input each promise but that a lone impl block never states, catching the five backends in this workspace (and any future one) disagreeing on them (retroglyph#763).

Modules§

conformance
Cross-backend conformance tests for Output, Cursor, and Input (retroglyph#763).

Structs§

InputRecording
A recorded input session: the backend size it was captured against, plus a timed sequence of events.
TestHarness
Drives an App against a Headless backend: queues synthetic input, steps frames, and reads back the rendered view.

Enums§

ClickTextError
Error returned by TestHarness::click_text when needle doesn’t appear in the current view.
RunError
Error returned by TestHarness::settle when the queue held more staged frames than the step budget.

Constants§

DEFAULT_MAX_STEPS
Default step budget for TestHarness::run before it treats a non-draining event queue as a stuck app and panics.
STEP_DELTA
Fixed per-frame delta TestHarness::step hands to App::update.