summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRyan Geary <rtgnj42@gmail.com>2020-04-04 22:29:51 -0400
committerRyan Geary <rtgnj42@gmail.com>2020-04-06 17:13:57 -0400
commit7243843d2f13d9fc84ffc0c757c7a73bbf6734ea (patch)
tree4c0f95cd4a5fda0c665ca38e4683c7ef730ad5d7 /test
parentd40c9d5234e4388b6321f9bea2f4b43e748b59fd (diff)
[FEATURE] specify output field delimiter (#8)
Add output_field_separator option Add output_field_separator tests Change structopt req to 0.3 Separate negative choices into a function Prevent tail printing output_field_separator Change OFS to Option<String> with a default value of " " Reorder arguments to write_bytes to parallel print_choice Print output_separator in main loop if applicable Add `cargo test` to Makefile Add write_separator function
Diffstat (limited to 'test')
-rw-r--r--test/choose_1:3of%.txt6
-rw-r--r--test/choose_1_3of%.txt6
-rw-r--r--test/choose_1_3of.txt6
-rwxr-xr-xtest/e2e_test.sh3
4 files changed, 21 insertions, 0 deletions
diff --git a/test/choose_1:3of%.txt b/test/choose_1:3of%.txt
new file mode 100644
index 0000000..a0fa11f
--- /dev/null
+++ b/test/choose_1:3of%.txt
@@ -0,0 +1,6 @@
+ipsum%dolor%sit
+ut%labore%et
+exercitation%ullamco%laboris
+aute%irure%dolor
+nulla%pariatur.%Excepteur
+qui%officia%deserunt
diff --git a/test/choose_1_3of%.txt b/test/choose_1_3of%.txt
new file mode 100644
index 0000000..351efb1
--- /dev/null
+++ b/test/choose_1_3of%.txt
@@ -0,0 +1,6 @@
+ipsum%sit
+ut%et
+exercitation%laboris
+aute%dolor
+nulla%Excepteur
+qui%deserunt
diff --git a/test/choose_1_3of.txt b/test/choose_1_3of.txt
new file mode 100644
index 0000000..614b128
--- /dev/null
+++ b/test/choose_1_3of.txt
@@ -0,0 +1,6 @@
+ipsumsit
+utet
+exercitationlaboris
+autedolor
+nullaExcepteur
+quideserunt
diff --git a/test/e2e_test.sh b/test/e2e_test.sh
index a415961..69ddd54 100755
--- a/test/e2e_test.sh
+++ b/test/e2e_test.sh
@@ -14,6 +14,9 @@ diff -w <(cargo run -- 9 -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir
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")
+diff -w <(cargo run -- 1:3 -o % -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_1:3of%.txt")
+diff -w <(cargo run -- 1 3 -o % -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_1_3of%.txt")
+diff -w <(cargo run -- 1 3 -o '' -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_1_3of.txt")
# add tests for different delimiters
# add tests using piping