diff options
author | jilles <jilles@FreeBSD.org> | 2017-03-12 19:49:08 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2017-03-12 19:49:08 +0000 |
commit | 702009ffa6e0983e98321eb8ed753712a046637c (patch) | |
tree | c3ccbdd18fe19a7681e31831ed24b15191f09c59 /bin | |
parent | ed7772a80846386215cb4074ed23e587bac053cc (diff) | |
download | FreeBSD-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/Makefile | 3 | ||||
-rw-r--r-- | bin/sh/tests/expansion/cmdsubst18.0 | 6 | ||||
-rw-r--r-- | bin/sh/tests/expansion/cmdsubst19.0 | 5 | ||||
-rw-r--r-- | bin/sh/tests/expansion/cmdsubst20.0 | 6 |
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 ] |