aboutsummaryrefslogtreecommitdiffstats
path: root/tests/attr.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-08 12:47:30 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-08 12:51:02 -0500
commit82fa0389acde185744a33fa92e35fd0f6e3b79e9 (patch)
tree2f9c8c4ef972914f097bc1b16d5c9d28e7a14290 /tests/attr.rs
parent6abfaac01daa6f1ba959c8e522d4fd439babaaee (diff)
downloadvt100-rust-82fa0389acde185744a33fa92e35fd0f6e3b79e9.tar.gz
vt100-rust-82fa0389acde185744a33fa92e35fd0f6e3b79e9.zip
remove unnecessary accessors
nobody should be caring about the terminal state internals
Diffstat (limited to 'tests/attr.rs')
-rw-r--r--tests/attr.rs60
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/attr.rs b/tests/attr.rs
index 18d20a2..1446bc5 100644
--- a/tests/attr.rs
+++ b/tests/attr.rs
@@ -3,8 +3,6 @@
#[test]
fn colors() {
let mut parser = vt100::Parser::new(24, 80);
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Default);
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Default);
parser.process(b"foo\x1b[31mbar");
@@ -28,9 +26,6 @@ fn colors() {
vt100::Color::Default
);
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Idx(1));
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Default);
-
parser.process(b"\x1b[2D\x1b[45mab");
assert_eq!(parser.screen().cell(0, 4).unwrap().contents(), "a");
@@ -43,14 +38,8 @@ fn colors() {
vt100::Color::Idx(5)
);
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Idx(1));
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Idx(5));
-
parser.process(b"\x1b[m");
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Default);
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Default);
-
parser.process(b"\x1b[15;15Hfoo\x1b[31mbar\x1b[m");
assert_eq!(parser.screen().cell(14, 14).unwrap().contents(), "f");
@@ -73,9 +62,6 @@ fn colors() {
vt100::Color::Default
);
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Default);
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Default);
-
parser.process(b"\x1b[2D\x1b[45mab");
assert_eq!(parser.screen().cell(14, 18).unwrap().contents(), "a");
@@ -88,15 +74,9 @@ fn colors() {
vt100::Color::Idx(5)
);
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Default);
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Idx(5));
-
parser.process(b"\x1b[m\x1b[2J\x1b[H");
parser.process(b"a\x1b[38;5;123mb\x1b[48;5;158mc");
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Idx(123));
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Idx(158));
-
assert_eq!(
parser.screen().cell(0, 0).unwrap().fgcolor(),
vt100::Color::Default
@@ -126,9 +106,6 @@ fn colors() {
parser.process(b"\x1b[38;2;50;75;100md\x1b[48;2;125;150;175me");
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Rgb(50, 75, 100));
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Rgb(125, 150, 175));
-
assert_eq!(
parser.screen().cell(0, 3).unwrap().fgcolor(),
vt100::Color::Rgb(50, 75, 100)
@@ -150,9 +127,6 @@ fn colors() {
parser.process(b"\x1b[m\x1b[2J\x1b[H");
parser.process(b"\x1b[32;47mfoo");
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Idx(2));
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Idx(7));
-
assert_eq!(
parser.screen().cell(0, 1).unwrap().fgcolor(),
vt100::Color::Idx(2)
@@ -165,9 +139,6 @@ fn colors() {
parser.process(b"\x1b[2J\x1b[H");
parser.process(b"\x1b[39mfoo");
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Default);
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Idx(7));
-
assert_eq!(
parser.screen().cell(0, 1).unwrap().fgcolor(),
vt100::Color::Default
@@ -180,9 +151,6 @@ fn colors() {
parser.process(b"\x1b[2J\x1b[H");
parser.process(b"\x1b[49mfoo");
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Default);
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Default);
-
assert_eq!(
parser.screen().cell(0, 1).unwrap().fgcolor(),
vt100::Color::Default
@@ -195,9 +163,6 @@ fn colors() {
parser.process(b"\x1b[m\x1b[2J\x1b[H");
parser.process(b"\x1b[92;107mfoo");
- assert_eq!(parser.screen().fgcolor(), vt100::Color::Idx(10));
- assert_eq!(parser.screen().bgcolor(), vt100::Color::Idx(15));
-
assert_eq!(
parser.screen().cell(0, 1).unwrap().fgcolor(),
vt100::Color::Idx(10)
@@ -211,16 +176,8 @@ fn colors() {
#[test]
fn attrs() {
let mut parser = vt100::Parser::new(24, 80);
- assert!(!parser.screen().bold());
- assert!(!parser.screen().italic());
- assert!(!parser.screen().underline());
- assert!(!parser.screen().inverse());
parser.process(b"f\x1b[1mo\x1b[3mo\x1b[4mo\x1b[7mo");
- assert!(parser.screen().bold());
- assert!(parser.screen().italic());
- assert!(parser.screen().underline());
- assert!(parser.screen().inverse());
assert!(!parser.screen().cell(0, 0).unwrap().bold());
assert!(!parser.screen().cell(0, 0).unwrap().italic());
assert!(!parser.screen().cell(0, 0).unwrap().underline());
@@ -243,27 +200,14 @@ fn attrs() {
assert!(parser.screen().cell(0, 4).unwrap().inverse());
parser.process(b"\x1b[m");
- assert!(!parser.screen().bold());
- assert!(!parser.screen().italic());
- assert!(!parser.screen().underline());
- assert!(!parser.screen().inverse());
-
parser.process(b"\x1b[2J\x1b[H");
parser.process(b"\x1b[1;4mf");
- assert!(parser.screen().bold());
- assert!(!parser.screen().italic());
- assert!(parser.screen().underline());
- assert!(!parser.screen().inverse());
assert!(parser.screen().cell(0, 0).unwrap().bold());
assert!(!parser.screen().cell(0, 0).unwrap().italic());
assert!(parser.screen().cell(0, 0).unwrap().underline());
assert!(!parser.screen().cell(0, 0).unwrap().inverse());
parser.process(b"\x1b[22mo\x1b[24mo");
- assert!(!parser.screen().bold());
- assert!(!parser.screen().italic());
- assert!(!parser.screen().underline());
- assert!(!parser.screen().inverse());
assert!(!parser.screen().cell(0, 1).unwrap().bold());
assert!(!parser.screen().cell(0, 1).unwrap().italic());
assert!(parser.screen().cell(0, 1).unwrap().underline());
@@ -274,10 +218,6 @@ fn attrs() {
assert!(!parser.screen().cell(0, 2).unwrap().inverse());
parser.process(b"\x1b[1;3;4;7mo");
- assert!(parser.screen().bold());
- assert!(parser.screen().italic());
- assert!(parser.screen().underline());
- assert!(parser.screen().inverse());
assert!(parser.screen().cell(0, 3).unwrap().bold());
assert!(parser.screen().cell(0, 3).unwrap().italic());
assert!(parser.screen().cell(0, 3).unwrap().underline());