Skip to main content

Module headless

Module headless 

Source
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§

HeadlessTerm
A headless terminal for testing without real terminal I/O.
LineDiff
A single line difference in a screen comparison.
ScreenDiff
Result of comparing screen content with expected lines.