summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2015-08-20 21:31:36 +0000
committerjilles <jilles@FreeBSD.org>2015-08-20 21:31:36 +0000
commit5d7936e9513610780b41d2d2524f2c33afed6359 (patch)
tree2527953f954e5784bec6d83cc4bc6a4ae3018ea7 /bin
parentfe0a547dd0529b8fe1f9bfa1f450bfe1206b688f (diff)
downloadFreeBSD-src-5d7936e9513610780b41d2d2524f2c33afed6359.zip
FreeBSD-src-5d7936e9513610780b41d2d2524f2c33afed6359.tar.gz
sh: Add test for $'\u' without any digits.
It is likely that $'\uXXXX' and $'\UXXXXXXXX' will allow fewer digits in future. However, no digits at all should still be disallowed.
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/tests/parser/Makefile1
-rw-r--r--bin/sh/tests/parser/dollar-quote12.07
2 files changed, 8 insertions, 0 deletions
diff --git a/bin/sh/tests/parser/Makefile b/bin/sh/tests/parser/Makefile
index 3c9e62c..83df985 100644
--- a/bin/sh/tests/parser/Makefile
+++ b/bin/sh/tests/parser/Makefile
@@ -36,6 +36,7 @@ FILES+= dollar-quote8.0
FILES+= dollar-quote9.0
FILES+= dollar-quote10.0
FILES+= dollar-quote11.0
+FILES+= dollar-quote12.0
FILES+= empty-braces1.0
FILES+= empty-cmd1.0
FILES+= for1.0
diff --git a/bin/sh/tests/parser/dollar-quote12.0 b/bin/sh/tests/parser/dollar-quote12.0
new file mode 100644
index 0000000..838e27c
--- /dev/null
+++ b/bin/sh/tests/parser/dollar-quote12.0
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+# \u without any digits at all remains invalid.
+# Our choice is a parse error.
+
+v=$( (eval ": \$'\u'") 2>&1 >/dev/null)
+[ $? -ne 0 ] && [ -n "$v" ]
OpenPOWER on IntegriCloud