aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-20 12:11:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:33 +0200
commit53d649dec4c98c9f08b963ed913685a83d68e7e1 (patch)
tree8b4af61415bc1bd9ee7074f999442f5384bc34ac /unit-tests/test
parent55211f91fa8120ff0cb545157ad8e4cf5669c2e8 (diff)
Fix testscript here-document quoting issue
Diffstat (limited to 'unit-tests/test')
-rw-r--r--unit-tests/test/script/parser/command-re-parse.test9
-rw-r--r--unit-tests/test/script/parser/here-document.test20
2 files changed, 29 insertions, 0 deletions
diff --git a/unit-tests/test/script/parser/command-re-parse.test b/unit-tests/test/script/parser/command-re-parse.test
new file mode 100644
index 0000000..956052d
--- /dev/null
+++ b/unit-tests/test/script/parser/command-re-parse.test
@@ -0,0 +1,9 @@
+
+# double-quote
+#
+$* <<EOI >>EOO
+x = cmd \\">!\\" "'<!'"
+$x
+EOI
+cmd ">!" "<!"
+EOO
diff --git a/unit-tests/test/script/parser/here-document.test b/unit-tests/test/script/parser/here-document.test
new file mode 100644
index 0000000..7cfa8d4
--- /dev/null
+++ b/unit-tests/test/script/parser/here-document.test
@@ -0,0 +1,20 @@
+
+# quote
+#
+# Note: they are still recognized in eval contexts.
+#
+$* <<EOI >>EOO
+cmd <<EOF
+'single'
+"double"
+b'o't"h"
+('single' "double")
+EOF
+EOI
+cmd <<EOF
+'single'
+"double"
+b'o't"h"
+'single' "double"
+EOF
+EOO