diff options
Diffstat (limited to 'tests/basic.rs')
-rw-r--r-- | tests/basic.rs | 24 |
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) + ); + } } |