svn commit: r287755 - in stable/10/bin/sh/tests: expansion parameters parser
Jilles Tjoelker
jilles at FreeBSD.org
Sun Sep 13 14:24:16 UTC 2015
Author: jilles
Date: Sun Sep 13 14:24:12 2015
New Revision: 287755
URL: https://svnweb.freebsd.org/changeset/base/287755
Log:
MFC r268436,273243,278806,280920,286971: sh: Add various tests.
These new tests from head pass with unmodified stable/10 sh.
Added:
stable/10/bin/sh/tests/expansion/ifs5.0
- copied unchanged from r278806, head/bin/sh/tests/expansion/ifs5.0
stable/10/bin/sh/tests/expansion/ifs6.0
- copied unchanged from r280920, head/bin/sh/tests/expansion/ifs6.0
stable/10/bin/sh/tests/expansion/ifs7.0
- copied unchanged from r280920, head/bin/sh/tests/expansion/ifs7.0
stable/10/bin/sh/tests/expansion/pathname5.0
- copied unchanged from r278806, head/bin/sh/tests/expansion/pathname5.0
stable/10/bin/sh/tests/parameters/positional3.0
- copied unchanged from r268436, head/bin/sh/tests/parameters/positional3.0
stable/10/bin/sh/tests/parser/dollar-quote12.0
- copied unchanged from r286971, head/bin/sh/tests/parser/dollar-quote12.0
stable/10/bin/sh/tests/parser/line-cont1.0
- copied unchanged from r273243, head/bin/sh/tests/parser/line-cont1.0
stable/10/bin/sh/tests/parser/line-cont2.0
- copied unchanged from r273243, head/bin/sh/tests/parser/line-cont2.0
stable/10/bin/sh/tests/parser/line-cont3.0
- copied unchanged from r273243, head/bin/sh/tests/parser/line-cont3.0
Modified:
stable/10/bin/sh/tests/expansion/Makefile
stable/10/bin/sh/tests/parameters/Makefile
stable/10/bin/sh/tests/parser/Makefile
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/bin/sh/tests/expansion/Makefile
==============================================================================
--- stable/10/bin/sh/tests/expansion/Makefile Sun Sep 13 14:04:42 2015 (r287754)
+++ stable/10/bin/sh/tests/expansion/Makefile Sun Sep 13 14:24:12 2015 (r287755)
@@ -45,6 +45,9 @@ FILES+= ifs1.0
FILES+= ifs2.0
FILES+= ifs3.0
FILES+= ifs4.0
+FILES+= ifs5.0
+FILES+= ifs6.0
+FILES+= ifs7.0
FILES+= length1.0
FILES+= length2.0
FILES+= length3.0
@@ -59,6 +62,7 @@ FILES+= pathname1.0
FILES+= pathname2.0
FILES+= pathname3.0
FILES+= pathname4.0
+FILES+= pathname5.0
FILES+= plus-minus1.0
FILES+= plus-minus2.0
FILES+= plus-minus3.0
Copied: stable/10/bin/sh/tests/expansion/ifs5.0 (from r278806, head/bin/sh/tests/expansion/ifs5.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/expansion/ifs5.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r278806, head/bin/sh/tests/expansion/ifs5.0)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+set -- $(echo a b c d)
+[ "$#" = 4 ]
Copied: stable/10/bin/sh/tests/expansion/ifs6.0 (from r280920, head/bin/sh/tests/expansion/ifs6.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/expansion/ifs6.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r280920, head/bin/sh/tests/expansion/ifs6.0)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+IFS=': '
+x=': :'
+set -- $x
+[ "$#|$1|$2|$3" = "2|||" ]
Copied: stable/10/bin/sh/tests/expansion/ifs7.0 (from r280920, head/bin/sh/tests/expansion/ifs7.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/expansion/ifs7.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r280920, head/bin/sh/tests/expansion/ifs7.0)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+IFS=2
+set -- $((123))
+[ "$#|$1|$2|$3" = "2|1|3|" ]
Copied: stable/10/bin/sh/tests/expansion/pathname5.0 (from r278806, head/bin/sh/tests/expansion/pathname5.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/expansion/pathname5.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r278806, head/bin/sh/tests/expansion/pathname5.0)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+[ `echo '/[e]tc'` = /etc ]
Modified: stable/10/bin/sh/tests/parameters/Makefile
==============================================================================
--- stable/10/bin/sh/tests/parameters/Makefile Sun Sep 13 14:04:42 2015 (r287754)
+++ stable/10/bin/sh/tests/parameters/Makefile Sun Sep 13 14:24:12 2015 (r287755)
@@ -13,6 +13,7 @@ FILES+= optind1.0
FILES+= optind2.0
FILES+= positional1.0
FILES+= positional2.0
+FILES+= positional3.0
FILES+= positional5.0
FILES+= pwd1.0
FILES+= pwd2.0
Copied: stable/10/bin/sh/tests/parameters/positional3.0 (from r268436, head/bin/sh/tests/parameters/positional3.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/parameters/positional3.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r268436, head/bin/sh/tests/parameters/positional3.0)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+r=$(${SH} -c 'echo ${01:+yes}${010:+yes}' '' a '' '' '' '' '' '' '' '' b)
+[ "$r" = yesyes ]
Modified: stable/10/bin/sh/tests/parser/Makefile
==============================================================================
--- stable/10/bin/sh/tests/parser/Makefile Sun Sep 13 14:04:42 2015 (r287754)
+++ stable/10/bin/sh/tests/parser/Makefile Sun Sep 13 14:24:12 2015 (r287755)
@@ -34,6 +34,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
@@ -52,6 +53,9 @@ FILES+= heredoc8.0
FILES+= heredoc9.0
FILES+= heredoc10.0
FILES+= heredoc11.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
Copied: stable/10/bin/sh/tests/parser/dollar-quote12.0 (from r286971, head/bin/sh/tests/parser/dollar-quote12.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/parser/dollar-quote12.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r286971, head/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" ]
Copied: stable/10/bin/sh/tests/parser/line-cont1.0 (from r273243, head/bin/sh/tests/parser/line-cont1.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/parser/line-cont1.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r273243, head/bin/sh/tests/parser/line-cont1.0)
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+i\
+f
+t\
+r\
+u\
+e
+t\
+h\
+e\
+n
+:
+\
+f\
+i
Copied: stable/10/bin/sh/tests/parser/line-cont2.0 (from r273243, head/bin/sh/tests/parser/line-cont2.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/parser/line-cont2.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r273243, head/bin/sh/tests/parser/line-cont2.0)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+[ "a\
+b" = ab ]
Copied: stable/10/bin/sh/tests/parser/line-cont3.0 (from r273243, head/bin/sh/tests/parser/line-cont3.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/bin/sh/tests/parser/line-cont3.0 Sun Sep 13 14:24:12 2015 (r287755, copy of r273243, head/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 ]
More information about the svn-src-stable-10
mailing list