aboutsummaryrefslogtreecommitdiffstats
path: root/tests/attr.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-29 14:24:28 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-29 14:24:28 -0400
commit267f7452949617375c8570caf4b03b434e3350e8 (patch)
tree517ba3be3617c8ca60e804b1e033388e069c37b0 /tests/attr.rs
parentf84638fd816d2295c5d9f60c0ac8eb6df50d1aba (diff)
downloadvt100-rust-267f7452949617375c8570caf4b03b434e3350e8.tar.gz
vt100-rust-267f7452949617375c8570caf4b03b434e3350e8.zip
basic structure of vte parser
Diffstat (limited to 'tests/attr.rs')
-rw-r--r--tests/attr.rs35
1 files changed, 16 insertions, 19 deletions
diff --git a/tests/attr.rs b/tests/attr.rs
index e621098..cae7555 100644
--- a/tests/attr.rs
+++ b/tests/attr.rs
@@ -1,15 +1,12 @@
#![allow(clippy::cognitive_complexity)]
-mod support;
-use support::TestHelpers;
-
#[test]
fn colors() {
let mut screen = vt100::Screen::new(24, 80);
assert_eq!(screen.fgcolor(), vt100::Color::Default);
assert_eq!(screen.bgcolor(), vt100::Color::Default);
- screen.assert_process(b"foo\x1b[31mbar");
+ screen.process(b"foo\x1b[31mbar");
assert_eq!(screen.cell(0, 0).unwrap().contents(), "f");
assert_eq!(screen.cell(0, 0).unwrap().fgcolor(), vt100::Color::Default);
@@ -22,7 +19,7 @@ fn colors() {
assert_eq!(screen.fgcolor(), vt100::Color::Idx(1));
assert_eq!(screen.bgcolor(), vt100::Color::Default);
- screen.assert_process(b"\x1b[2D\x1b[45mab");
+ screen.process(b"\x1b[2D\x1b[45mab");
assert_eq!(screen.cell(0, 4).unwrap().contents(), "a");
assert_eq!(screen.cell(0, 4).unwrap().fgcolor(), vt100::Color::Idx(1));
@@ -31,12 +28,12 @@ fn colors() {
assert_eq!(screen.fgcolor(), vt100::Color::Idx(1));
assert_eq!(screen.bgcolor(), vt100::Color::Idx(5));
- screen.assert_process(b"\x1b[m");
+ screen.process(b"\x1b[m");
assert_eq!(screen.fgcolor(), vt100::Color::Default);
assert_eq!(screen.bgcolor(), vt100::Color::Default);
- screen.assert_process(b"\x1b[15;15Hfoo\x1b[31mbar\x1b[m");
+ screen.process(b"\x1b[15;15Hfoo\x1b[31mbar\x1b[m");
assert_eq!(screen.cell(14, 14).unwrap().contents(), "f");
assert_eq!(
@@ -58,7 +55,7 @@ fn colors() {
assert_eq!(screen.fgcolor(), vt100::Color::Default);
assert_eq!(screen.bgcolor(), vt100::Color::Default);
- screen.assert_process(b"\x1b[2D\x1b[45mab");
+ screen.process(b"\x1b[2D\x1b[45mab");
assert_eq!(screen.cell(14, 18).unwrap().contents(), "a");
assert_eq!(
@@ -70,8 +67,8 @@ fn colors() {
assert_eq!(screen.fgcolor(), vt100::Color::Default);
assert_eq!(screen.bgcolor(), vt100::Color::Idx(5));
- screen.assert_process(b"\x1b[m\x1b[2J\x1b[H");
- screen.assert_process(b"a\x1b[38;5;123mb\x1b[48;5;158mc");
+ screen.process(b"\x1b[m\x1b[2J\x1b[H");
+ screen.process(b"a\x1b[38;5;123mb\x1b[48;5;158mc");
assert_eq!(screen.fgcolor(), vt100::Color::Idx(123));
assert_eq!(screen.bgcolor(), vt100::Color::Idx(158));
@@ -85,7 +82,7 @@ fn colors() {
assert_eq!(screen.cell(0, 2).unwrap().fgcolor(), vt100::Color::Idx(123));
assert_eq!(screen.cell(0, 2).unwrap().bgcolor(), vt100::Color::Idx(158));
- screen.assert_process(b"\x1b[38;2;50;75;100md\x1b[48;2;125;150;175me");
+ screen.process(b"\x1b[38;2;50;75;100md\x1b[48;2;125;150;175me");
assert_eq!(screen.fgcolor(), vt100::Color::Rgb(50, 75, 100));
assert_eq!(screen.bgcolor(), vt100::Color::Rgb(125, 150, 175));
@@ -105,8 +102,8 @@ fn colors() {
vt100::Color::Rgb(125, 150, 175)
);
- screen.assert_process(b"\x1b[m\x1b[2J\x1b[H");
- screen.assert_process(b"\x1b[32;47mfoo");
+ screen.process(b"\x1b[m\x1b[2J\x1b[H");
+ screen.process(b"\x1b[32;47mfoo");
assert_eq!(screen.fgcolor(), vt100::Color::Idx(2));
assert_eq!(screen.bgcolor(), vt100::Color::Idx(7));
@@ -123,7 +120,7 @@ fn attrs() {
assert!(!screen.underline());
assert!(!screen.inverse());
- screen.assert_process(b"f\x1b[1mo\x1b[3mo\x1b[4mo\x1b[7mo");
+ screen.process(b"f\x1b[1mo\x1b[3mo\x1b[4mo\x1b[7mo");
assert!(screen.bold());
assert!(screen.italic());
assert!(screen.underline());
@@ -149,14 +146,14 @@ fn attrs() {
assert!(screen.cell(0, 4).unwrap().underline());
assert!(screen.cell(0, 4).unwrap().inverse());
- screen.assert_process(b"\x1b[m");
+ screen.process(b"\x1b[m");
assert!(!screen.bold());
assert!(!screen.italic());
assert!(!screen.underline());
assert!(!screen.inverse());
- screen.assert_process(b"\x1b[2J\x1b[H");
- screen.assert_process(b"\x1b[1;4mf");
+ screen.process(b"\x1b[2J\x1b[H");
+ screen.process(b"\x1b[1;4mf");
assert!(screen.bold());
assert!(!screen.italic());
assert!(screen.underline());
@@ -166,7 +163,7 @@ fn attrs() {
assert!(screen.cell(0, 0).unwrap().underline());
assert!(!screen.cell(0, 0).unwrap().inverse());
- screen.assert_process(b"\x1b[22mo\x1b[24mo");
+ screen.process(b"\x1b[22mo\x1b[24mo");
assert!(!screen.bold());
assert!(!screen.italic());
assert!(!screen.underline());
@@ -180,7 +177,7 @@ fn attrs() {
assert!(!screen.cell(0, 2).unwrap().underline());
assert!(!screen.cell(0, 2).unwrap().inverse());
- screen.assert_process(b"\x1b[1;3;4;7mo");
+ screen.process(b"\x1b[1;3;4;7mo");
assert!(screen.bold());
assert!(screen.italic());
assert!(screen.underline());