From aadfe4f9155818054c52140bc5f919cea4fde9cb Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 1 Nov 2019 14:07:18 -0400 Subject: implement a few more sgr modes --- tests/attr.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests/attr.rs') 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] -- cgit v1.2.3-54-g00ecf