diff options
author | Denys Vlasenko | 2021-07-27 04:20:32 +0200 |
---|---|---|
committer | Denys Vlasenko | 2021-07-27 04:20:32 +0200 |
commit | c450437a4e631378cd6a2dc06a5923ce811a950d (patch) | |
tree | 448ad0b6599a5365dedd8f78960957a722c0aecb /shell/ash_test/ash-psubst/falsetick.tests | |
parent | 8dd676c6c3b862846a4a215f5f3a8822fcf8c569 (diff) | |
download | busybox-c450437a4e631378cd6a2dc06a5923ce811a950d.zip busybox-c450437a4e631378cd6a2dc06a5923ce811a950d.tar.gz |
shell: update psubst testcases
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-psubst/falsetick.tests')
-rwxr-xr-x | shell/ash_test/ash-psubst/falsetick.tests | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/shell/ash_test/ash-psubst/falsetick.tests b/shell/ash_test/ash-psubst/falsetick.tests new file mode 100755 index 0000000..d2b9369 --- /dev/null +++ b/shell/ash_test/ash-psubst/falsetick.tests @@ -0,0 +1,19 @@ +# 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 $? |