summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRyan Geary <rtgnj42@gmail.com>2020-03-17 13:56:25 -0400
committerRyan Geary <rtgnj42@gmail.com>2020-04-01 13:15:32 -0400
commite78ea2783cf99de0d4dd430af403e88fc1edbf0e (patch)
tree0137966dc93ca74e305ca6e3234d1935e8463a72 /test
parenta90a5cb74273eba36357a25096e4bd7840d19cb8 (diff)
Add negative choice and parsing tests
Allow negative ranges as long as they aren't reversed too Allow reversed negative ranges iff both indices are negative
Diffstat (limited to 'test')
-rw-r--r--test/choose_-4:-2.txt6
-rwxr-xr-xtest/e2e_test.sh1
2 files changed, 7 insertions, 0 deletions
diff --git a/test/choose_-4:-2.txt b/test/choose_-4:-2.txt
new file mode 100644
index 0000000..313a492
--- /dev/null
+++ b/test/choose_-4:-2.txt
@@ -0,0 +1,6 @@
+sed do eiusmod
+ad minim veniam,
+ex ea commodo
+esse cillum dolore
+non proident, sunt
+anim id est
diff --git a/test/e2e_test.sh b/test/e2e_test.sh
index 1f2556a..a415961 100755
--- a/test/e2e_test.sh
+++ b/test/e2e_test.sh
@@ -13,6 +13,7 @@ diff -w <(cargo run -- 9 3 -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_d
diff -w <(cargo run -- 9 -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_9.txt")
diff -w <(cargo run -- 12 -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_12.txt")
diff -w <(cargo run -- 4:2 -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_4:2.txt")
+diff -w <(cargo run -- -4:-2 -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_-4:-2.txt")
# add tests for different delimiters
# add tests using piping