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

This commit is contained in:
Jilles Tjoelker 2017-03-03 22:46:20 +00:00
parent 7abf460488
commit 549bbb4fa1
4 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -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 ]

View File

@ -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 ]

View File

@ -0,0 +1,6 @@
# $FreeBSD$
set -T
trapped=''
trap "trapped=x$trapped" USR1
[ "x$(kill -USR1 $$)y" = xy ] && [ "$trapped" = x ]