Expand description
Headless terminal for CI testing.
HeadlessTerm wraps TerminalModel to provide a high-level test harness
that works without a real terminal or PTY. It is designed for:
- CI environments where PTY tests are slow or unavailable
- Snapshot testing with human-readable diff output
- Render pipeline verification by feeding presenter output through the terminal model and checking the result
§Example
use ftui_render::headless::HeadlessTerm;
let mut term = HeadlessTerm::new(20, 5);
term.process(b"\x1b[1;1HHello, world!");
assert_eq!(term.row_text(0), "Hello, world!");
term.assert_matches(&[
"Hello, world!",
"",
"",
"",
"",
]);Structs§
- Headless
Term - A headless terminal for testing without real terminal I/O.
- Line
Diff - A single line difference in a screen comparison.
- Screen
Diff - Result of comparing screen content with expected lines.