aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-10-27 15:47:43 +0300
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:36 +0200
commit94f807424dbf1ed7c33ba7826f1b19b49c413b63 (patch)
treeb65e137e6e714435b6a9b00301d40c9c26fa17f5
parentadf27f5e17f4de774b3121c3669e3947ad4c9ca5 (diff)
Add more test command file redirect tests
-rw-r--r--unit-tests/test/script/parser/redirect.test46
1 files changed, 46 insertions, 0 deletions
diff --git a/unit-tests/test/script/parser/redirect.test b/unit-tests/test/script/parser/redirect.test
index f7dbdbc..6274669 100644
--- a/unit-tests/test/script/parser/redirect.test
+++ b/unit-tests/test/script/parser/redirect.test
@@ -1,9 +1,55 @@
+# @@ Add tests for redirects other than file and merge.
+# @@ Does it make sense to split into separate files - one per redirect type?
+#
+
$* <<EOI >>EOO # file
cmd 0<<<a 1>>>b 2>>>&c
EOI
cmd <<<a >>>b 2>>>&c
EOO
+$* <<EOI >>EOO # quote-file
+cmd 0<<<"a f" 1>>>"b f" 2>>>&"c f"
+EOI
+cmd <<<"a f" >>>"b f" 2>>>&"c f"
+EOO
+
+$* <<EOI 2>>EOE !=0 # in-file-fail1
+cmd <<<
+EOI
+testscript:1:8: error: missing stdin file
+EOE
+
+$* <<EOI 2>>EOE !=0 # in-file-fail2
+cmd <<<""
+EOI
+testscript:1:8: error: empty stdin redirect file path
+EOE
+
+$* <<EOI 2>>EOE !=0 # out-file-fail1
+cmd >>>
+EOI
+testscript:1:8: error: missing stdout file
+EOE
+
+$* <<EOI 2>>EOE !=0 # out-file-fail2
+cmd >>>""
+EOI
+testscript:1:8: error: empty stdout redirect file path
+EOE
+
+$* <<EOI 2>>EOE !=0 # err-file-fail1
+cmd 2>>>
+EOI
+testscript:1:9: error: missing stderr file
+EOE
+
+$* <<EOI 2>>EOE !=0 # err-file-fail2
+cmd 2>>>""
+EOI
+testscript:1:9: error: empty stderr redirect file path
+EOE
+
$* <<EOI >>EOO # out-merge1
cmd 1>&2
EOI