Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions crates/reconverge-tui/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,31 @@ fn inspect_reproduces_the_checked_in_shell_golden() {
);
let printed = stdout(&out);
assert!(printed.starts_with("size: 80x24"), "{printed}");
// The shell is a TUI, so inspect reports the deadline rather than an
// The shell is a TUI, so inspect reports it still running rather than an
// exit — on **stderr** since termlens 0.11 (termlens#340), so that what
// stdout carries is a saved screen and needs no filtering here. Against
// 0.10.x the trailer followed the screen on stdout and this test dropped
// the line itself.
// the line itself. Which "still running" it is depends on what ended the
// wait: since termlens 0.11.3 (#374) a shell that goes quiet for `--idle`
// reads `still running (killed on exit)`, and only one that keeps
// printing until `--timeout` says `at the deadline`. Both mean it did not
// exit, which is all this asserts.
assert!(
String::from_utf8_lossy(&out.stderr).contains("still running at the deadline"),
String::from_utf8_lossy(&out.stderr).contains("still running"),
"the shell does not exit on its own: {}",
String::from_utf8_lossy(&out.stderr)
);
assert!(
!printed.contains("--- "),
"stdout is the screen alone:\n{printed}"
);
let screen = printed.clone();
// Through a pipe, inspect writes a saved screen *with* its `styles:`
// block since termlens 0.11.3 (#454, #478), where the checked-in goldens
// are the grid alone. The grid is what the two paths into a screen have
// to agree on here, so the block is dropped the way the other golden
// checks drop it (`grid_of`); against 0.11.2 there is none and this is
// the whole screen.
let screen = format!("{}\n", grid_of(&printed));
let live = env::temp_dir().join(format!("reconverge-inspect-{}.snap", std::process::id()));
fs::write(&live, &screen).expect("write the inspected screen");

Expand Down
Loading