aboutsummaryrefslogtreecommitdiffstats
path: root/tests/basic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basic.rs')
-rw-r--r--tests/basic.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/basic.rs b/tests/basic.rs
index 7312928..27b688d 100644
--- a/tests/basic.rs
+++ b/tests/basic.rs
@@ -25,4 +25,18 @@ mod tests {
assert_eq!(screen.rows(), 34);
assert_eq!(screen.cols(), 8);
}
+
+ #[test]
+ fn cell_contents() {
+ 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().contents(), "f");
+ assert_eq!(screen.cell(0, 1).unwrap().contents(), "o");
+ assert_eq!(screen.cell(0, 2).unwrap().contents(), "o");
+ assert_eq!(screen.cell(0, 3).unwrap().contents(), "b");
+ assert_eq!(screen.cell(0, 4).unwrap().contents(), "a");
+ assert_eq!(screen.cell(0, 5).unwrap().contents(), "r");
+ assert_eq!(screen.cell(0, 6).unwrap().contents(), "");
+ }
}