diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-05 01:32:25 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-05 01:32:25 -0500 |
commit | 4b4a9c18e4c55a2ba6558ef614292db9c18ab88a (patch) | |
tree | 03c9ada690835acbf3d1b02f46341bde5b579989 /tests/weird.rs | |
parent | 59e7c620a516278719c1689ebebeb558bede5b60 (diff) | |
download | vt100-rust-4b4a9c18e4c55a2ba6558ef614292db9c18ab88a.tar.gz vt100-rust-4b4a9c18e4c55a2ba6558ef614292db9c18ab88a.zip |
expose the screen separately from the parser
Diffstat (limited to 'tests/weird.rs')
-rw-r--r-- | tests/weird.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/weird.rs b/tests/weird.rs index 20cc571..6719644 100644 --- a/tests/weird.rs +++ b/tests/weird.rs @@ -1,17 +1,17 @@ #[test] fn intermediate_control() { - let mut screen = vt100::Screen::new(24, 80); - assert_eq!(screen.cursor_position(), (0, 0)); + let mut parser = vt100::Parser::new(24, 80); + assert_eq!(parser.screen().cursor_position(), (0, 0)); - screen.process(b"\x1b"); - assert_eq!(screen.cursor_position(), (0, 0)); + parser.process(b"\x1b"); + assert_eq!(parser.screen().cursor_position(), (0, 0)); - screen.process(b"["); - assert_eq!(screen.cursor_position(), (0, 0)); + parser.process(b"["); + assert_eq!(parser.screen().cursor_position(), (0, 0)); - screen.process(b"\n"); - assert_eq!(screen.cursor_position(), (1, 0)); + parser.process(b"\n"); + assert_eq!(parser.screen().cursor_position(), (1, 0)); - screen.process(b"C"); - assert_eq!(screen.cursor_position(), (1, 1)); + parser.process(b"C"); + assert_eq!(parser.screen().cursor_position(), (1, 1)); } |