summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2017-03-12 19:49:08 +0000
committerjilles <jilles@FreeBSD.org>2017-03-12 19:49:08 +0000
commit702009ffa6e0983e98321eb8ed753712a046637c (patch)
treec3ccbdd18fe19a7681e31831ed24b15191f09c59 /bin
parented7772a80846386215cb4074ed23e587bac053cc (diff)
downloadFreeBSD-src-702009ffa6e0983e98321eb8ed753712a046637c.zip
FreeBSD-src-702009ffa6e0983e98321eb8ed753712a046637c.tar.gz
MFC r314637: sh: Add some already working tests that exercise new code paths
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/tests/expansion/Makefile3
-rw-r--r--bin/sh/tests/expansion/cmdsubst18.06
-rw-r--r--bin/sh/tests/expansion/cmdsubst19.05
-rw-r--r--bin/sh/tests/expansion/cmdsubst20.06
4 files changed, 20 insertions, 0 deletions
diff --git a/bin/sh/tests/expansion/Makefile b/bin/sh/tests/expansion/Makefile
index d6f3c1a..fd1c3bb 100644
--- a/bin/sh/tests/expansion/Makefile
+++ b/bin/sh/tests/expansion/Makefile
@@ -38,6 +38,9 @@ FILES+= cmdsubst14.0
FILES+= cmdsubst15.0
FILES+= cmdsubst16.0
FILES+= cmdsubst17.0
+FILES+= cmdsubst18.0
+FILES+= cmdsubst19.0
+FILES+= cmdsubst20.0
FILES+= export1.0
FILES+= export2.0
FILES+= export3.0
diff --git a/bin/sh/tests/expansion/cmdsubst18.0 b/bin/sh/tests/expansion/cmdsubst18.0
new file mode 100644
index 0000000..a9791b3
--- /dev/null
+++ b/bin/sh/tests/expansion/cmdsubst18.0
@@ -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 ]
diff --git a/bin/sh/tests/expansion/cmdsubst19.0 b/bin/sh/tests/expansion/cmdsubst19.0
new file mode 100644
index 0000000..ae6619a
--- /dev/null
+++ b/bin/sh/tests/expansion/cmdsubst19.0
@@ -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 ]
diff --git a/bin/sh/tests/expansion/cmdsubst20.0 b/bin/sh/tests/expansion/cmdsubst20.0
new file mode 100644
index 0000000..3393248
--- /dev/null
+++ b/bin/sh/tests/expansion/cmdsubst20.0
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+set -T
+trapped=''
+trap "trapped=x$trapped" USR1
+[ "x$(kill -USR1 $$)y" = xy ] && [ "$trapped" = x ]
OpenPOWER on IntegriCloud