Skip to main content

Module test_utils

Module test_utils 

Source
Expand description

Headless test utilities for unit-testing TUI closures. Headless testing utilities.

TestBackend renders a UI closure to an in-memory buffer without a real terminal. EventBuilder constructs event sequences for simulating user input. Together they enable snapshot and assertion-based UI testing.

Structs§

EventBuilder
Builder for constructing a sequence of input Events.
FrameRecord
Snapshot of a single rendered frame, captured by TestBackend::record_frames.
PtyBackendpty-test
Drives the real crate::run flush pipeline into an in-process byte sink, so escape-code / color-depth / image-protocol output is asserted end-to-end — the byte/protocol tier that TestBackend’s buffer-only model deliberately cannot reach (see tests/visual_snapshots.rs).
PtyFramepty-test
Raw bytes emitted for a single rendered frame by PtyBackend.
TestBackend
Headless rendering backend for tests.
TestSequence
Builder returned by TestBackend::sequence.