diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-29 14:24:28 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-29 14:24:28 -0400 |
commit | 267f7452949617375c8570caf4b03b434e3350e8 (patch) | |
tree | 517ba3be3617c8ca60e804b1e033388e069c37b0 /tests/mode.rs | |
parent | f84638fd816d2295c5d9f60c0ac8eb6df50d1aba (diff) | |
download | vt100-rust-267f7452949617375c8570caf4b03b434e3350e8.tar.gz vt100-rust-267f7452949617375c8570caf4b03b434e3350e8.zip |
basic structure of vte parser
Diffstat (limited to 'tests/mode.rs')
-rw-r--r-- | tests/mode.rs | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/tests/mode.rs b/tests/mode.rs index 5f8b2a4..9658ad3 100644 --- a/tests/mode.rs +++ b/tests/mode.rs @@ -1,8 +1,5 @@ #![allow(clippy::cognitive_complexity)] -mod support; -use support::TestHelpers; - #[test] fn modes() { let mut screen = vt100::Screen::new(24, 80); @@ -15,7 +12,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1h"); + screen.process(b"\x1b[?1h"); assert!(!screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -26,7 +23,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b[?9h"); + screen.process(b"\x1b[?9h"); assert!(!screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -37,7 +34,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b[?25l"); + screen.process(b"\x1b[?25l"); assert!(screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -48,7 +45,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1000h"); + screen.process(b"\x1b[?1000h"); assert!(screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -59,7 +56,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1002h"); + screen.process(b"\x1b[?1002h"); assert!(screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -70,7 +67,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1006h"); + screen.process(b"\x1b[?1006h"); assert!(screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -81,7 +78,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b[?2004h"); + screen.process(b"\x1b[?2004h"); assert!(screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -92,7 +89,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b="); + screen.process(b"\x1b="); assert!(screen.hide_cursor()); assert!(screen.application_keypad()); @@ -103,7 +100,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1l"); + screen.process(b"\x1b[?1l"); assert!(screen.hide_cursor()); assert!(screen.application_keypad()); @@ -114,7 +111,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b[?9l"); + screen.process(b"\x1b[?9l"); assert!(screen.hide_cursor()); assert!(screen.application_keypad()); @@ -125,7 +122,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b[?25h"); + screen.process(b"\x1b[?25h"); assert!(!screen.hide_cursor()); assert!(screen.application_keypad()); @@ -136,7 +133,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1000l"); + screen.process(b"\x1b[?1000l"); assert!(!screen.hide_cursor()); assert!(screen.application_keypad()); @@ -147,7 +144,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1002l"); + screen.process(b"\x1b[?1002l"); assert!(!screen.hide_cursor()); assert!(screen.application_keypad()); @@ -158,7 +155,7 @@ fn modes() { assert!(screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b[?1006l"); + screen.process(b"\x1b[?1006l"); assert!(!screen.hide_cursor()); assert!(screen.application_keypad()); @@ -169,7 +166,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(screen.bracketed_paste()); - screen.assert_process(b"\x1b[?2004l"); + screen.process(b"\x1b[?2004l"); assert!(!screen.hide_cursor()); assert!(screen.application_keypad()); @@ -180,7 +177,7 @@ fn modes() { assert!(!screen.mouse_reporting_sgr_mode()); assert!(!screen.bracketed_paste()); - screen.assert_process(b"\x1b>"); + screen.process(b"\x1b>"); assert!(!screen.hide_cursor()); assert!(!screen.application_keypad()); @@ -195,21 +192,21 @@ fn modes() { #[test] fn alternate_buffer() { let mut screen = vt100::Screen::new(24, 80); - screen.assert_process(b"\x1b[m\x1b[2J\x1b[H1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24"); + screen.process(b"\x1b[m\x1b[2J\x1b[H1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24"); assert_eq!(screen.window_contents(0, 0, 23, 79), "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n"); assert!(!screen.alternate_buffer_active()); - screen.assert_process(b"\x1b[?1049h"); + screen.process(b"\x1b[?1049h"); assert_eq!( screen.window_contents(0, 0, 23, 79), "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" ); assert!(screen.alternate_buffer_active()); - screen.assert_process(b"foobar"); + screen.process(b"foobar"); assert_eq!( screen.window_contents(0, 0, 23, 79), "foobar\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" ); - screen.assert_process(b"\x1b[?1049l"); + screen.process(b"\x1b[?1049l"); assert_eq!(screen.window_contents(0, 0, 23, 79), "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n"); assert!(!screen.alternate_buffer_active()); } |