aboutsummaryrefslogtreecommitdiffstats
path: root/tests/attr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/attr.rs')
-rw-r--r--tests/attr.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/attr.rs b/tests/attr.rs
index cae7555..2cc94ba 100644
--- a/tests/attr.rs
+++ b/tests/attr.rs
@@ -110,6 +110,33 @@ fn colors() {
assert_eq!(screen.cell(0, 1).unwrap().fgcolor(), vt100::Color::Idx(2));
assert_eq!(screen.cell(0, 1).unwrap().bgcolor(), vt100::Color::Idx(7));
+
+ screen.process(b"\x1b[2J\x1b[H");
+ screen.process(b"\x1b[39mfoo");
+
+ assert_eq!(screen.fgcolor(), vt100::Color::Default);
+ assert_eq!(screen.bgcolor(), vt100::Color::Idx(7));
+
+ assert_eq!(screen.cell(0, 1).unwrap().fgcolor(), vt100::Color::Default);
+ assert_eq!(screen.cell(0, 1).unwrap().bgcolor(), vt100::Color::Idx(7));
+
+ screen.process(b"\x1b[2J\x1b[H");
+ screen.process(b"\x1b[49mfoo");
+
+ assert_eq!(screen.fgcolor(), vt100::Color::Default);
+ assert_eq!(screen.bgcolor(), vt100::Color::Default);
+
+ assert_eq!(screen.cell(0, 1).unwrap().fgcolor(), vt100::Color::Default);
+ assert_eq!(screen.cell(0, 1).unwrap().bgcolor(), vt100::Color::Default);
+
+ screen.process(b"\x1b[m\x1b[2J\x1b[H");
+ screen.process(b"\x1b[92;107mfoo");
+
+ assert_eq!(screen.fgcolor(), vt100::Color::Idx(10));
+ assert_eq!(screen.bgcolor(), vt100::Color::Idx(15));
+
+ assert_eq!(screen.cell(0, 1).unwrap().fgcolor(), vt100::Color::Idx(10));
+ assert_eq!(screen.cell(0, 1).unwrap().bgcolor(), vt100::Color::Idx(15));
}
#[test]