Skip to content

Commit

Permalink
Add alternate-screen scrolling test case
Browse files Browse the repository at this point in the history
The screen contents must be correct, but also
the stable_index must be maintained, even when in
alternate-screen mode, where scrollback lines are
discarded.
  • Loading branch information
loops committed Sep 25, 2024
1 parent 2b76c63 commit 2999574
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions term/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,18 @@ fn test_1573() {
assert_eq!(graphemes, vec![sequence]);
}

#[test]
fn test_6166() {
let smcup = "\u{1b}[?1049h\u{1b}[22;0;0t";

let mut term = TestTerm::new(5, 5, 0);
term.print(smcup);
term.print("1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8");
assert_eq!(term.screen().visible_row_to_stable_row(0), 3);

assert_all_contents(&term, file!(), line!(), &["4", "5", "6", "7", "8"]);
}

#[test]
fn test_hyperlinks() {
let mut term = TestTerm::new(3, 5, 0);
Expand Down

0 comments on commit 2999574

Please sign in to comment.