aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/test/script/parser/cleanup.test
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/test/script/parser/cleanup.test')
-rw-r--r--unit-tests/test/script/parser/cleanup.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/unit-tests/test/script/parser/cleanup.test b/unit-tests/test/script/parser/cleanup.test
new file mode 100644
index 0000000..7fe746d
--- /dev/null
+++ b/unit-tests/test/script/parser/cleanup.test
@@ -0,0 +1,35 @@
+$* <<EOI >>EOO # file-dir
+cmd &file &dir/
+EOI
+cmd &file &dir/
+EOO
+
+$* <<EOI >>EOO # quote-file-dir
+cmd &"f ile" &"d ir/"
+EOI
+cmd &"f ile" &"d ir/"
+EOO
+
+$* <<EOI >>EOO # dup-file
+cmd &file &file
+EOI
+cmd &file &file
+EOO
+
+$* <<EOI 2>>EOE != 0 # file-fail1
+cmd & >file
+EOI
+testscript:1:7: error: missing cleanup path
+EOE
+
+$* <<EOI 2>>EOE != 0 # file-fail2
+cmd &
+EOI
+testscript:1:6: error: missing cleanup path
+EOE
+
+$* <<EOI 2>>EOE != 0 # file-fail3
+cmd &""
+EOI
+testscript:1:6: error: empty cleanup path
+EOE