diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-12 05:47:32 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-12 05:51:17 -0500 |
commit | 28eea9f6a837dad5febfe9b021b7070e96b286f9 (patch) | |
tree | c48d13955c045b892b95f6e652f8be22938705d1 /tests/control.rs | |
parent | bdda29c8e82e22bf49b5588f341549d3f94d6d30 (diff) | |
download | vt100-rust-28eea9f6a837dad5febfe9b021b7070e96b286f9.tar.gz vt100-rust-28eea9f6a837dad5febfe9b021b7070e96b286f9.zip |
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.
Diffstat (limited to 'tests/control.rs')
-rw-r--r-- | tests/control.rs | 11 |
1 files changed, 8 insertions, 3 deletions
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] |