aboutsummaryrefslogtreecommitdiffstats
path: root/tests/basic.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-29 13:42:00 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-29 13:42:00 -0400
commitf84638fd816d2295c5d9f60c0ac8eb6df50d1aba (patch)
tree4562b26f23283710e454d257114813be1623ea1d /tests/basic.rs
parente525fddb572614f4c6d6a7d71ed44e9dfe7af350 (diff)
downloadvt100-rust-f84638fd816d2295c5d9f60c0ac8eb6df50d1aba.tar.gz
vt100-rust-f84638fd816d2295c5d9f60c0ac8eb6df50d1aba.zip
start the rewrite
Diffstat (limited to 'tests/basic.rs')
-rw-r--r--tests/basic.rs24
1 files changed, 5 insertions, 19 deletions
diff --git a/tests/basic.rs b/tests/basic.rs
index babec39..46d9265 100644
--- a/tests/basic.rs
+++ b/tests/basic.rs
@@ -1,5 +1,3 @@
-extern crate vt100;
-
#[test]
fn object_creation() {
let screen = vt100::Screen::new(24, 80);
@@ -17,7 +15,7 @@ fn process_text() {
#[test]
fn set_window_size() {
- let screen = vt100::Screen::new(24, 80);
+ let mut screen = vt100::Screen::new(24, 80);
assert_eq!(screen.rows(), 24);
assert_eq!(screen.cols(), 80);
@@ -46,22 +44,10 @@ fn cell_colors() {
let input = b"foo\x1b[31m\x1b[32mb\x1b[3;7;42ma\x1b[23mr";
screen.process(input);
- assert_eq!(
- screen.cell(0, 0).unwrap().fgcolor(),
- vt100::Color::ColorDefault
- );
- assert_eq!(
- screen.cell(0, 3).unwrap().fgcolor(),
- vt100::Color::ColorIdx(2)
- );
- assert_eq!(
- screen.cell(0, 4).unwrap().fgcolor(),
- vt100::Color::ColorIdx(2)
- );
- assert_eq!(
- screen.cell(0, 4).unwrap().bgcolor(),
- vt100::Color::ColorIdx(2)
- );
+ assert_eq!(screen.cell(0, 0).unwrap().fgcolor(), vt100::Color::Default);
+ assert_eq!(screen.cell(0, 3).unwrap().fgcolor(), vt100::Color::Idx(2));
+ assert_eq!(screen.cell(0, 4).unwrap().fgcolor(), vt100::Color::Idx(2));
+ assert_eq!(screen.cell(0, 4).unwrap().bgcolor(), vt100::Color::Idx(2));
}
#[test]