busybox/shell/hush_test/hush-psubst/falsetick.tests
Denys Vlasenko c450437a4e shell: update psubst testcases
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-07-27 04:20:32 +02:00

20 lines
722 B
Plaintext
Executable File

# Exitcode 0 (`` has no exitcode, but assignment has):
true; a=``; echo $?
false; a=``; echo $?
true; a=$(); echo $?
false; a=$(); echo $?
# Exitcode 2 (`cmd` expansion sets exitcode after assignment set it to 0):
true; a=`exit 2`; echo $?
false; a=`exit 2`; echo $?
true; a=$(exit 2); echo $?
false; a=$(exit 2); echo $?
# Exitcode 1 (redirect sets exitcode to 1 on error after them):
true; a=`` >/does/not/exist; echo $?
false; a=`` >/does/not/exist; echo $?
true; a=$() >/does/not/exist; echo $?
false; a=$() >/does/not/exist; echo $?
true; a=`exit 2` >/does/not/exist; echo $?
false; a=`exit 2` >/does/not/exist; echo $?
true; a=$(exit 2) >/does/not/exist; echo $?
false; a=$(exit 2) >/does/not/exist; echo $?