From 4b4a9c18e4c55a2ba6558ef614292db9c18ab88a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 5 Nov 2019 01:32:25 -0500 Subject: expose the screen separately from the parser --- tests/weird.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/weird.rs') 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)); } -- cgit v1.2.3-54-g00ecf