summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
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