diff options
author | jilles <jilles@FreeBSD.org> | 2017-03-12 18:24:45 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2017-03-12 18:24:45 +0000 |
commit | c52ab07b68286c4c43d14217015a2fc847019e99 (patch) | |
tree | 31e58cd2bb388bb946c1acf53cccbe5177000855 | |
parent | 87fa9281a7ad81967bc23a38d2660362ab839921 (diff) | |
download | FreeBSD-src-c52ab07b68286c4c43d14217015a2fc847019e99.zip FreeBSD-src-c52ab07b68286c4c43d14217015a2fc847019e99.tar.gz |
MFC r314637: sh: Add some already working tests that exercise new code paths
-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 eccf239..3c0dfa3 100644 --- a/bin/sh/tests/expansion/Makefile +++ b/bin/sh/tests/expansion/Makefile @@ -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 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 ] |