From 28eea9f6a837dad5febfe9b021b7070e96b286f9 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 12 Nov 2019 05:47:32 -0500 Subject: remove parser.screen_mut it's easier to reason about if you are only able to get an immutable reference to the internal screen. this also required changing the api for bells. --- tests/control.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/control.rs') diff --git a/tests/control.rs b/tests/control.rs index 9392b5e..aba6915 100644 --- a/tests/control.rs +++ b/tests/control.rs @@ -3,12 +3,17 @@ #[test] fn bel() { let mut parser = vt100::Parser::default(); + assert_eq!(parser.screen().audible_bell_count(), 0); - assert!(!parser.screen_mut().check_audible_bell()); + parser.process(b"\x07"); + assert_eq!(parser.screen().audible_bell_count(), 1); + assert_eq!(parser.screen().audible_bell_count(), 1); parser.process(b"\x07"); - assert!(parser.screen_mut().check_audible_bell()); - assert!(!parser.screen_mut().check_audible_bell()); + assert_eq!(parser.screen().audible_bell_count(), 2); + + parser.process(b"\x07\x07\x07"); + assert_eq!(parser.screen().audible_bell_count(), 5); } #[test] -- cgit v1.2.3-54-g00ecf