Skip to main content

Module tui

Module tui 

Source
Expand description

TUI Testing Support (Feature 21 - EDD Compliance) TUI Testing Support (Feature 21 - EDD Compliance)

Test terminal user interfaces with zero external dependencies. Uses custom TextGrid and MockTty for 100% provable UX.

§EXTREME TDD: Tests written FIRST per spec

§Toyota Way Application

  • Poka-Yoke: Type-safe frame capture with TextGrid
  • Muda: Direct buffer comparison without rendering overhead
  • Genchi Genbutsu: MockTty reflects actual terminal behavior
  • Jidoka: Fail-fast on frame mismatch

§ComputeBlock Testing (PROBAR-SPEC-009)

With the compute-blocks feature, probar supports testing presentar-terminal ComputeBlocks with SIMD verification and latency budget assertions.

use jugar_probar::tui::{ComputeBlockAssertion, assert_brick_valid};
use presentar_terminal::SparklineBlock;

let block = SparklineBlock::new(60);
assert_brick_valid(&block).unwrap();

ComputeBlockAssertion::new(&block)
    .to_have_simd_support()
    .to_have_latency_under(100);

Structs§

FrameAssertion
Frame assertion builder (Playwright-style API)
FrameDiff
Difference between two frames
FrameSequence
Sequence of frames for animation testing
LineDiff
A single line difference
MockTty
Mock TTY backend that captures output and tracks terminal state.
MultiValueTracker
Multi-value tracker for monitoring multiple named values
SnapshotManager
Snapshot manager for organizing and comparing snapshots
TextGrid
Simple text grid for TUI testing (replaces presentar-terminal CellBuffer).
TuiFrame
A captured TUI frame for testing
TuiSnapshot
TUI Snapshot for golden file testing
TuiTestBackend
TUI Test Backend for capturing frames
ValueTracker
Value tracker for monitoring changes over time

Enums§

AnsiCommand
Parsed ANSI command for testing assertions.
ClearMode
Clear mode for ED (erase display) and EL (erase line) commands.

Functions§

expect_frame
Create a frame assertion