aboutsummaryrefslogtreecommitdiffstats
path: root/tests/basic.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-04-27 02:36:30 -0400
committerJesse Luehrs <doy@tozt.net>2016-04-27 03:03:46 -0400
commitdf328c13903d5a0e595d27b14f79e2a61f66f8fc (patch)
tree84812f3b90cd60a38a461e1b33e059365309492c /tests/basic.rs
parent65b2ce10f83942a9dd2974ac19c694f1c6c9e617 (diff)
downloadvt100-rust-df328c13903d5a0e595d27b14f79e2a61f66f8fc.tar.gz
vt100-rust-df328c13903d5a0e595d27b14f79e2a61f66f8fc.zip
implement fgcolor and bgcolor for cells
Diffstat (limited to 'tests/basic.rs')
-rw-r--r--tests/basic.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/basic.rs b/tests/basic.rs
index 4828ea9..7af33f0 100644
--- a/tests/basic.rs
+++ b/tests/basic.rs
@@ -43,4 +43,28 @@ mod tests {
assert_eq!(screen.cell(0, 5).unwrap().contents(), "r");
assert_eq!(screen.cell(0, 6).unwrap().contents(), "");
}
+
+ #[test]
+ fn cell_colors() {
+ let mut screen = vt100::Screen::new(24, 80);
+ let input = b"foo\x1b[31m\x1b[32mb\x1b[3;7;42ma\x1b[23mr";
+ screen.process(input);
+
+ assert_eq!(
+ screen.cell(0, 0).unwrap().fgcolor(),
+ vt100::Color::ColorDefault
+ );
+ assert_eq!(
+ screen.cell(0, 3).unwrap().fgcolor(),
+ vt100::Color::ColorIdx(2)
+ );
+ assert_eq!(
+ screen.cell(0, 4).unwrap().fgcolor(),
+ vt100::Color::ColorIdx(2)
+ );
+ assert_eq!(
+ screen.cell(0, 4).unwrap().bgcolor(),
+ vt100::Color::ColorIdx(2)
+ );
+ }
}