aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-03 12:01:11 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-03 12:03:52 -0500
commitbf5813ba9cefacad3e8535478747f61c45ed41c2 (patch)
tree63441e4c36e07cf3a5827dd078c51aed56948542
parent481f6d62265916992dd5b7d3cb3c98c48004372a (diff)
downloadvt100-rust-bf5813ba9cefacad3e8535478747f61c45ed41c2.tar.gz
vt100-rust-bf5813ba9cefacad3e8535478747f61c45ed41c2.zip
fix test code
-rw-r--r--examples/fuzz.rs1
-rw-r--r--tests/data/fixtures/relative_movement.in1
-rw-r--r--tests/data/fixtures/relative_movement/17.json13
-rw-r--r--tests/data/fixtures/relative_movement/17.typescript1
-rw-r--r--tests/helpers/mod.rs1
5 files changed, 17 insertions, 0 deletions
diff --git a/examples/fuzz.rs b/examples/fuzz.rs
index 3d1c160..6283102 100644
--- a/examples/fuzz.rs
+++ b/examples/fuzz.rs
@@ -65,6 +65,7 @@ fn check_rows(vt_base: &vt100::Screen, empty: &vt100::Screen, idx: usize) {
input.extend(&row);
wrapped = vt_base.row_wrapped(idx.try_into().unwrap());
}
+ input.extend(b"\x1b[m");
input.extend(&vt_base.cursor_state_formatted());
input.extend(&vt_base.attributes_formatted());
input.extend(&vt_base.input_mode_formatted());
diff --git a/tests/data/fixtures/relative_movement.in b/tests/data/fixtures/relative_movement.in
index 785de31..1e744f5 100644
--- a/tests/data/fixtures/relative_movement.in
+++ b/tests/data/fixtures/relative_movement.in
@@ -14,3 +14,4 @@
\x1b[9A
\x1b[500B
\x1b[500A
+\x1b[24;80H\x1b[1ma\x1b[A
diff --git a/tests/data/fixtures/relative_movement/17.json b/tests/data/fixtures/relative_movement/17.json
new file mode 100644
index 0000000..b029aab
--- /dev/null
+++ b/tests/data/fixtures/relative_movement/17.json
@@ -0,0 +1,13 @@
+{
+ "contents": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n a",
+ "cells": {
+ "23,79": {
+ "contents": "a",
+ "bold": true
+ }
+ },
+ "cursor_position": [
+ 22,
+ 80
+ ]
+} \ No newline at end of file
diff --git a/tests/data/fixtures/relative_movement/17.typescript b/tests/data/fixtures/relative_movement/17.typescript
new file mode 100644
index 0000000..fa1477e
--- /dev/null
+++ b/tests/data/fixtures/relative_movement/17.typescript
@@ -0,0 +1 @@
+a \ No newline at end of file
diff --git a/tests/helpers/mod.rs b/tests/helpers/mod.rs
index a5b4ce6..c671684 100644
--- a/tests/helpers/mod.rs
+++ b/tests/helpers/mod.rs
@@ -154,6 +154,7 @@ pub fn rows_formatted_reproduces_screen(screen: &vt100::Screen) -> bool {
new_input.extend(row);
wrapped = screen.row_wrapped(idx.try_into().unwrap());
}
+ new_input.extend(b"\x1b[m");
new_input.extend(screen.cursor_state_formatted());
new_input.extend(screen.attributes_formatted());
new_input.extend(screen.input_mode_formatted());