diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-01 14:07:18 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-01 14:07:18 -0400 |
commit | aadfe4f9155818054c52140bc5f919cea4fde9cb (patch) | |
tree | b5a5fd671284c085705a4a19eecd1e6bfb99301e /tests/attr.rs | |
parent | 1b0bca8204b25f46c68202f9b8e90801f41b35c9 (diff) | |
download | vt100-rust-aadfe4f9155818054c52140bc5f919cea4fde9cb.tar.gz vt100-rust-aadfe4f9155818054c52140bc5f919cea4fde9cb.zip |
implement a few more sgr modes
Diffstat (limited to 'tests/attr.rs')
-rw-r--r-- | tests/attr.rs | 27 |
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] |