diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:33:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:33:23 +0000 |
commit | 1d5cace9db9aef76f26b2d7ba54bbb76443b00b2 (patch) | |
tree | 314a15dd1aa103da13bdc83ba1d2105a290bc5ba /tests/posixexp2.sub | |
parent | Initial commit. (diff) | |
download | bash-1d5cace9db9aef76f26b2d7ba54bbb76443b00b2.tar.xz bash-1d5cace9db9aef76f26b2d7ba54bbb76443b00b2.zip |
Adding upstream version 5.0.upstream/5.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/posixexp2.sub')
-rw-r--r-- | tests/posixexp2.sub | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/posixexp2.sub b/tests/posixexp2.sub new file mode 100644 index 0000000..397769d --- /dev/null +++ b/tests/posixexp2.sub @@ -0,0 +1,24 @@ + +x=a\ b +[ "$x" = "${x?}" ] || exit 1 +set -- ${x?} +{ [ "$#" = 2 ] && [ "$1" = a ] && [ "$2" = b ]; } || exit 1 +unset x +(echo ${x?abcdefg}) 2>&1 | grep abcdefg >/dev/null || exit 1 +${THIS_SH} -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 2 +${THIS_SH} -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 3 +${THIS_SH} -c 'foo=; echo ${foo?}' >/dev/null || exit 4 +${THIS_SH} -c 'foo=1; echo ${foo:?}' >/dev/null || exit 5 +${THIS_SH} -c 'echo ${!?}' 2>/dev/null && exit 6 +${THIS_SH} -c ':& echo ${!?}' >/dev/null || exit 7 +${THIS_SH} -c 'echo ${#?}' >/dev/null || exit 8 +${THIS_SH} -c 'echo ${*?}' 2>/dev/null && exit 9 +${THIS_SH} -c 'echo ${*?}' ${THIS_SH} x >/dev/null || exit 10 +${THIS_SH} -c 'echo ${1?}' 2>/dev/null && exit 11 +${THIS_SH} -c 'echo ${1?}' ${THIS_SH} x >/dev/null || exit 12 +${THIS_SH} -c 'echo ${2?}' ${THIS_SH} x 2>/dev/null && exit 13 +${THIS_SH} -c 'echo ${2?}' ${THIS_SH} x y >/dev/null || exit 14 + +${THIS_SH} -c $'echo $(( x+ )) \n exit 0' ${THIS_SH} 2>/dev/null && exit 15 + +exit 0 |