aboutsummaryrefslogtreecommitdiffstats
path: root/tests/attr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/attr.rs')
-rw-r--r--tests/attr.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/attr.rs b/tests/attr.rs
index 64f4bd4..34ac7af 100644
--- a/tests/attr.rs
+++ b/tests/attr.rs
@@ -9,3 +9,15 @@ fn colors() {
fn attrs() {
helpers::fixture("attrs");
}
+
+#[test]
+fn attributes_formatted() {
+ let mut parser = vt100::Parser::default();
+ assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m");
+ parser.process(b"\x1b[32mfoo\x1b[41mbar\x1b[33mbaz");
+ assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m\x1b[33;41m");
+ parser.process(b"\x1b[1m\x1b[39m");
+ assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m\x1b[41;1m");
+ parser.process(b"\x1b[m");
+ assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m");
+}