summaryrefslogtreecommitdiffstats
path: root/bin/sh/tests
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2014-10-17 21:52:57 +0000
committerjilles <jilles@FreeBSD.org>2014-10-17 21:52:57 +0000
commita6283e56879f2b58cde7c5684cf1e1741e10f224 (patch)
treeab778fc1b505476c942638d5e59fa322016759eb /bin/sh/tests
parente9ac97fe26d54377d4ba91448a3d5496f49169e8 (diff)
downloadFreeBSD-src-a6283e56879f2b58cde7c5684cf1e1741e10f224.zip
FreeBSD-src-a6283e56879f2b58cde7c5684cf1e1741e10f224.tar.gz
sh: Add some tests for backslash-newline continuation.
Diffstat (limited to 'bin/sh/tests')
-rw-r--r--bin/sh/tests/parser/Makefile3
-rw-r--r--bin/sh/tests/parser/line-cont1.016
-rw-r--r--bin/sh/tests/parser/line-cont2.04
-rw-r--r--bin/sh/tests/parser/line-cont3.07
4 files changed, 30 insertions, 0 deletions
diff --git a/bin/sh/tests/parser/Makefile b/bin/sh/tests/parser/Makefile
index 7b77cb8..ef528f8 100644
--- a/bin/sh/tests/parser/Makefile
+++ b/bin/sh/tests/parser/Makefile
@@ -55,6 +55,9 @@ FILES+= heredoc9.0
FILES+= heredoc10.0
FILES+= heredoc11.0
FILES+= heredoc12.0
+FILES+= line-cont1.0
+FILES+= line-cont2.0
+FILES+= line-cont3.0
FILES+= no-space1.0
FILES+= no-space2.0
FILES+= only-redir1.0
diff --git a/bin/sh/tests/parser/line-cont1.0 b/bin/sh/tests/parser/line-cont1.0
new file mode 100644
index 0000000..7ef5eba
--- /dev/null
+++ b/bin/sh/tests/parser/line-cont1.0
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+i\
+f
+t\
+r\
+u\
+e
+t\
+h\
+e\
+n
+:
+\
+f\
+i
diff --git a/bin/sh/tests/parser/line-cont2.0 b/bin/sh/tests/parser/line-cont2.0
new file mode 100644
index 0000000..9a293fa
--- /dev/null
+++ b/bin/sh/tests/parser/line-cont2.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+[ "a\
+b" = ab ]
diff --git a/bin/sh/tests/parser/line-cont3.0 b/bin/sh/tests/parser/line-cont3.0
new file mode 100644
index 0000000..09d3aa8
--- /dev/null
+++ b/bin/sh/tests/parser/line-cont3.0
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+v=`printf %s 'a\
+b'`
+w="`printf %s 'c\
+d'`"
+[ "$v$w" = abcd ]
OpenPOWER on IntegriCloud