aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-01 15:08:32 -0400
committerJesse Luehrs <doy@tozt.net>2019-11-01 15:08:32 -0400
commite2aeb18fa5f05458bdaa8488cc6424109f908855 (patch)
treecc15f13bffafc34c2744c0732d9f9eedc7b6ad6b /tests
parentcb1595a43afa2f71ba1047d089fc7d60d88c6888 (diff)
downloadvt100-rust-e2aeb18fa5f05458bdaa8488cc6424109f908855.tar.gz
vt100-rust-e2aeb18fa5f05458bdaa8488cc6424109f908855.zip
there's no reason title and icon_name should be options
Diffstat (limited to 'tests')
-rw-r--r--tests/escape.rs12
-rw-r--r--tests/init.rs4
-rw-r--r--tests/osc.rs36
-rw-r--r--tests/processing.rs24
4 files changed, 38 insertions, 38 deletions
diff --git a/tests/escape.rs b/tests/escape.rs
index e80234a..1651ee5 100644
--- a/tests/escape.rs
+++ b/tests/escape.rs
@@ -37,8 +37,8 @@ fn ris() {
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
);
- assert_eq!(screen.title(), None);
- assert_eq!(screen.icon_name(), None);
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
assert_eq!(screen.fgcolor(), vt100::Color::Default);
assert_eq!(screen.bgcolor(), vt100::Color::Default);
@@ -72,8 +72,8 @@ fn ris() {
);
assert_eq!(screen.window_contents_formatted(0, 0, 23, 79), "f\x1b[31;47;1;3;4moo\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- assert_eq!(screen.title().unwrap(), "window title");
- assert_eq!(screen.icon_name().unwrap(), "window icon name");
+ assert_eq!(screen.title(), "window title");
+ assert_eq!(screen.icon_name(), "window icon name");
assert_eq!(screen.fgcolor(), vt100::Color::Idx(1));
assert_eq!(screen.bgcolor(), vt100::Color::Idx(7));
@@ -110,8 +110,8 @@ fn ris() {
);
// title and icon name don't change with reset
- assert_eq!(screen.title().unwrap(), "window title");
- assert_eq!(screen.icon_name().unwrap(), "window icon name");
+ assert_eq!(screen.title(), "window title");
+ assert_eq!(screen.icon_name(), "window icon name");
assert_eq!(screen.fgcolor(), vt100::Color::Default);
assert_eq!(screen.bgcolor(), vt100::Color::Default);
diff --git a/tests/init.rs b/tests/init.rs
index f5c896a..4eb3910 100644
--- a/tests/init.rs
+++ b/tests/init.rs
@@ -25,8 +25,8 @@ fn init() {
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
);
- assert_eq!(screen.title(), None);
- assert_eq!(screen.icon_name(), None);
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
assert_eq!(screen.fgcolor(), vt100::Color::Default);
assert_eq!(screen.bgcolor(), vt100::Color::Default);
diff --git a/tests/osc.rs b/tests/osc.rs
index 001ad53..4a02592 100644
--- a/tests/osc.rs
+++ b/tests/osc.rs
@@ -1,40 +1,40 @@
#[test]
fn title() {
let mut screen = vt100::Screen::new(24, 80);
- assert!(screen.title().is_none());
- assert!(screen.icon_name().is_none());
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
screen.process(b"\x1b]2;it's a title\x07");
- assert_eq!(screen.title().unwrap(), "it's a title");
- assert!(screen.icon_name().is_none());
+ assert_eq!(screen.title(), "it's a title");
+ assert_eq!(screen.icon_name(), "");
screen.process(b"\x1b]2;\x07");
- assert_eq!(screen.title().unwrap(), "");
- assert!(screen.icon_name().is_none());
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
}
#[test]
fn icon_name() {
let mut screen = vt100::Screen::new(24, 80);
- assert!(screen.title().is_none());
- assert!(screen.icon_name().is_none());
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
screen.process(b"\x1b]1;it's an icon name\x07");
- assert!(screen.title().is_none());
- assert_eq!(screen.icon_name().unwrap(), "it's an icon name");
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "it's an icon name");
screen.process(b"\x1b]1;\x07");
- assert!(screen.title().is_none());
- assert_eq!(screen.icon_name().unwrap(), "");
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
}
#[test]
fn title_icon_name() {
let mut screen = vt100::Screen::new(24, 80);
- assert!(screen.title().is_none());
- assert!(screen.icon_name().is_none());
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
screen.process(b"\x1b]0;it's both\x07");
- assert_eq!(screen.title().unwrap(), "it's both");
- assert_eq!(screen.icon_name().unwrap(), "it's both");
+ assert_eq!(screen.title(), "it's both");
+ assert_eq!(screen.icon_name(), "it's both");
screen.process(b"\x1b]0;\x07");
- assert_eq!(screen.title().unwrap(), "");
- assert_eq!(screen.icon_name().unwrap(), "");
+ assert_eq!(screen.title(), "");
+ assert_eq!(screen.icon_name(), "");
}
#[test]
diff --git a/tests/processing.rs b/tests/processing.rs
index 0e801d2..b5b212a 100644
--- a/tests/processing.rs
+++ b/tests/processing.rs
@@ -73,59 +73,59 @@ fn split_escape_sequences() {
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
screen.process(b"\x1b");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"]");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"0");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b";");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"a");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b" ");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"'");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"[");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"]");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"_");
- assert_eq!(screen.title(), None);
+ assert_eq!(screen.title(), "");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);
screen.process(b"\x07");
- assert_eq!(screen.title(), Some("a '[]_"));
+ assert_eq!(screen.title(), "a '[]_");
assert!(screen.mouse_reporting_press_release());
assert_eq!(screen.cursor_position(), (11, 23));
assert_eq!(screen.window_contents(0, 0, 23, 79), contents);