aboutsummaryrefslogtreecommitdiffstats
path: root/tests/control.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-12 15:37:31 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-12 15:40:48 -0500
commite85e57949df612e22463c06fc31fb0b7957ea3c7 (patch)
tree02543dc13dd61c70be68a71a4f43aea4a5a9f30c /tests/control.rs
parent89654c576119ba958a57e9c557d974b657d7c986 (diff)
downloadvt100-rust-e85e57949df612e22463c06fc31fb0b7957ea3c7.tar.gz
vt100-rust-e85e57949df612e22463c06fc31fb0b7957ea3c7.zip
split formatted calculations into multiple methods
different applications want to be able to apply different things, so this gives more control
Diffstat (limited to 'tests/control.rs')
-rw-r--r--tests/control.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/control.rs b/tests/control.rs
index 8372cea..e0dc276 100644
--- a/tests/control.rs
+++ b/tests/control.rs
@@ -9,27 +9,32 @@ fn bel() {
parser.process(b"\x07");
assert_eq!(parser.screen().audible_bell_count(), 1);
assert_eq!(parser.screen().audible_bell_count(), 1);
- assert_eq!(parser.screen().contents_diff(&screen), b"\x07");
+ assert_eq!(parser.screen().contents_diff(&screen), b"");
+ assert_eq!(parser.screen().bells_diff(&screen), b"\x07");
let screen = parser.screen().clone();
parser.process(b"\x07");
assert_eq!(parser.screen().audible_bell_count(), 2);
- assert_eq!(parser.screen().contents_diff(&screen), b"\x07");
+ assert_eq!(parser.screen().contents_diff(&screen), b"");
+ assert_eq!(parser.screen().bells_diff(&screen), b"\x07");
let screen = parser.screen().clone();
parser.process(b"\x07\x07\x07");
assert_eq!(parser.screen().audible_bell_count(), 5);
- assert_eq!(parser.screen().contents_diff(&screen), b"\x07");
+ assert_eq!(parser.screen().contents_diff(&screen), b"");
+ assert_eq!(parser.screen().bells_diff(&screen), b"\x07");
let screen = parser.screen().clone();
parser.process(b"foo");
assert_eq!(parser.screen().audible_bell_count(), 5);
assert_eq!(parser.screen().contents_diff(&screen), b"foo");
+ assert_eq!(parser.screen().bells_diff(&screen), b"");
let screen = parser.screen().clone();
parser.process(b"ba\x07r");
assert_eq!(parser.screen().audible_bell_count(), 6);
- assert_eq!(parser.screen().contents_diff(&screen), b"bar\x07");
+ assert_eq!(parser.screen().contents_diff(&screen), b"bar");
+ assert_eq!(parser.screen().bells_diff(&screen), b"\x07");
}
#[test]