diff options
author | Ryan Geary <rtgnj42@gmail.com> | 2019-09-10 23:36:39 -0400 |
---|---|---|
committer | Ryan Geary <rtgnj42@gmail.com> | 2019-09-10 23:36:39 -0400 |
commit | 4b6d44e1214f1059da3c697b3952ec15e11c8dce (patch) | |
tree | a315f2136f4f2c32df20561bedaa7569b0afc5e5 | |
parent | ddf563d41b0e77b1f1518652a9304d13d5542f3d (diff) |
Add basic test suite
-rw-r--r-- | test/choose_0:2.txt | 6 | ||||
-rw-r--r-- | test/choose_0_3.txt | 6 | ||||
-rw-r--r-- | test/choose_9.txt | 6 | ||||
-rw-r--r-- | test/choose_9_3.txt | 6 | ||||
-rw-r--r-- | test/choose_:2.txt | 6 | ||||
-rw-r--r-- | test/lorem.txt | 6 | ||||
-rwxr-xr-x | test/test.sh | 13 |
7 files changed, 49 insertions, 0 deletions
diff --git a/test/choose_0:2.txt b/test/choose_0:2.txt new file mode 100644 index 0000000..38b492a --- /dev/null +++ b/test/choose_0:2.txt @@ -0,0 +1,6 @@ +Lorem ipsum +incididunt ut +nostrud exercitation +Duis aute +fugiat nulla +culpa qui diff --git a/test/choose_0_3.txt b/test/choose_0_3.txt new file mode 100644 index 0000000..87dd3c5 --- /dev/null +++ b/test/choose_0_3.txt @@ -0,0 +1,6 @@ +Lorem sit +incididunt et +nostrud laboris +Duis dolor +fugiat Excepteur +culpa deserunt diff --git a/test/choose_9.txt b/test/choose_9.txt new file mode 100644 index 0000000..dbc3782 --- /dev/null +++ b/test/choose_9.txt @@ -0,0 +1,6 @@ +do +ad +commodo +esse +sunt + diff --git a/test/choose_9_3.txt b/test/choose_9_3.txt new file mode 100644 index 0000000..05b039f --- /dev/null +++ b/test/choose_9_3.txt @@ -0,0 +1,6 @@ +do sit +ad et +commodo laboris +esse dolor +sunt Excepteur + deserunt diff --git a/test/choose_:2.txt b/test/choose_:2.txt new file mode 100644 index 0000000..38b492a --- /dev/null +++ b/test/choose_:2.txt @@ -0,0 +1,6 @@ +Lorem ipsum +incididunt ut +nostrud exercitation +Duis aute +fugiat nulla +culpa qui diff --git a/test/lorem.txt b/test/lorem.txt new file mode 100644 index 0000000..7b95d6b --- /dev/null +++ b/test/lorem.txt @@ -0,0 +1,6 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor +incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis +nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu +fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 0000000..f1d438a --- /dev/null +++ b/test/test.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +test_dir="test" +orig_dir="$(pwd)" +cd "$(git rev-parse --show-toplevel)" +cargo build + +diff -Z <(cargo run -- 0:2 -i ${test_dir}/lorem.txt) <(cat "${test_dir}/choose_0:2.txt") +diff -Z <(cargo run -- 0 3 -i ${test_dir}/lorem.txt) <(cat "${test_dir}/choose_0_3.txt") +diff -Z <(cargo run -- :2 -i ${test_dir}/lorem.txt) <(cat "${test_dir}/choose_:2.txt") +diff -Z <(cargo run -- 9 3 -i ${test_dir}/lorem.txt) <(cat "${test_dir}/choose_9_3.txt") +diff -Z <(cargo run -- 9 -i ${test_dir}/lorem.txt) <(cat "${test_dir}/choose_9.txt") |