svn commit: r314637 - head/bin/sh/tests/expansion

Jilles Tjoelker jilles at FreeBSD.org
Fri Mar 3 22:46:22 UTC 2017


Author: jilles
Date: Fri Mar  3 22:46:20 2017
New Revision: 314637
URL: https://svnweb.freebsd.org/changeset/base/314637

Log:
  sh: Add some already working tests that exercise new code paths.

Added:
  head/bin/sh/tests/expansion/cmdsubst18.0   (contents, props changed)
  head/bin/sh/tests/expansion/cmdsubst19.0   (contents, props changed)
  head/bin/sh/tests/expansion/cmdsubst20.0   (contents, props changed)
Modified:
  head/bin/sh/tests/expansion/Makefile

Modified: head/bin/sh/tests/expansion/Makefile
==============================================================================
--- head/bin/sh/tests/expansion/Makefile	Fri Mar  3 22:42:43 2017	(r314636)
+++ head/bin/sh/tests/expansion/Makefile	Fri Mar  3 22:46:20 2017	(r314637)
@@ -39,6 +39,9 @@ ${PACKAGE}FILES+=	cmdsubst14.0
 ${PACKAGE}FILES+=	cmdsubst15.0
 ${PACKAGE}FILES+=	cmdsubst16.0
 ${PACKAGE}FILES+=	cmdsubst17.0
+${PACKAGE}FILES+=	cmdsubst18.0
+${PACKAGE}FILES+=	cmdsubst19.0
+${PACKAGE}FILES+=	cmdsubst20.0
 ${PACKAGE}FILES+=	export1.0
 ${PACKAGE}FILES+=	export2.0
 ${PACKAGE}FILES+=	export3.0

Added: head/bin/sh/tests/expansion/cmdsubst18.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/bin/sh/tests/expansion/cmdsubst18.0	Fri Mar  3 22:46:20 2017	(r314637)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+x=X
+unset n
+r=${x+$(echo a)}${x-$(echo b)}${n+$(echo c)}${n-$(echo d)}$(echo e)
+[ "$r" = aXde ]

Added: head/bin/sh/tests/expansion/cmdsubst19.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/bin/sh/tests/expansion/cmdsubst19.0	Fri Mar  3 22:46:20 2017	(r314637)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+b=200 c=30 d=5 x=4
+r=$(echo a)$(($(echo b) + ${x+$(echo c)} + ${x-$(echo d)}))$(echo e)
+[ "$r" = a234e ]

Added: head/bin/sh/tests/expansion/cmdsubst20.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/bin/sh/tests/expansion/cmdsubst20.0	Fri Mar  3 22:46:20 2017	(r314637)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+set -T
+trapped=''
+trap "trapped=x$trapped" USR1
+[ "x$(kill -USR1 $$)y" = xy ] && [ "$trapped" = x ]


More information about the svn-src-all mailing list