diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-27 04:20:32 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-27 04:20:32 +0200 |
commit | c450437a4e631378cd6a2dc06a5923ce811a950d (patch) | |
tree | 448ad0b6599a5365dedd8f78960957a722c0aecb /shell/ash_test | |
parent | 8dd676c6c3b862846a4a215f5f3a8822fcf8c569 (diff) | |
download | busybox-w32-c450437a4e631378cd6a2dc06a5923ce811a950d.tar.gz busybox-w32-c450437a4e631378cd6a2dc06a5923ce811a950d.tar.bz2 busybox-w32-c450437a4e631378cd6a2dc06a5923ce811a950d.zip |
shell: update psubst testcases
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-psubst/falsetick.right | 24 | ||||
-rwxr-xr-x | shell/ash_test/ash-psubst/falsetick.tests | 19 | ||||
-rw-r--r-- | shell/ash_test/ash-psubst/falsetick2.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-psubst/falsetick2.tests | 3 |
4 files changed, 47 insertions, 0 deletions
diff --git a/shell/ash_test/ash-psubst/falsetick.right b/shell/ash_test/ash-psubst/falsetick.right new file mode 100644 index 000000000..0335254a8 --- /dev/null +++ b/shell/ash_test/ash-psubst/falsetick.right | |||
@@ -0,0 +1,24 @@ | |||
1 | 0 | ||
2 | 0 | ||
3 | 0 | ||
4 | 0 | ||
5 | 2 | ||
6 | 2 | ||
7 | 2 | ||
8 | 2 | ||
9 | ./falsetick.tests: line 12: can't create /does/not/exist: nonexistent directory | ||
10 | 1 | ||
11 | ./falsetick.tests: line 13: can't create /does/not/exist: nonexistent directory | ||
12 | 1 | ||
13 | ./falsetick.tests: line 14: can't create /does/not/exist: nonexistent directory | ||
14 | 1 | ||
15 | ./falsetick.tests: line 15: can't create /does/not/exist: nonexistent directory | ||
16 | 1 | ||
17 | ./falsetick.tests: line 16: can't create /does/not/exist: nonexistent directory | ||
18 | 1 | ||
19 | ./falsetick.tests: line 17: can't create /does/not/exist: nonexistent directory | ||
20 | 1 | ||
21 | ./falsetick.tests: line 18: can't create /does/not/exist: nonexistent directory | ||
22 | 1 | ||
23 | ./falsetick.tests: line 19: can't create /does/not/exist: nonexistent directory | ||
24 | 1 | ||
diff --git a/shell/ash_test/ash-psubst/falsetick.tests b/shell/ash_test/ash-psubst/falsetick.tests new file mode 100755 index 000000000..d2b93695e --- /dev/null +++ b/shell/ash_test/ash-psubst/falsetick.tests | |||
@@ -0,0 +1,19 @@ | |||
1 | # Exitcode 0 (`` has no exitcode, but assignment has): | ||
2 | true; a=``; echo $? | ||
3 | false; a=``; echo $? | ||
4 | true; a=$(); echo $? | ||
5 | false; a=$(); echo $? | ||
6 | # Exitcode 2 (`cmd` expansion sets exitcode after assignment set it to 0): | ||
7 | true; a=`exit 2`; echo $? | ||
8 | false; a=`exit 2`; echo $? | ||
9 | true; a=$(exit 2); echo $? | ||
10 | false; a=$(exit 2); echo $? | ||
11 | # Exitcode 1 (redirect sets exitcode to 1 on error after them): | ||
12 | true; a=`` >/does/not/exist; echo $? | ||
13 | false; a=`` >/does/not/exist; echo $? | ||
14 | true; a=$() >/does/not/exist; echo $? | ||
15 | false; a=$() >/does/not/exist; echo $? | ||
16 | true; a=`exit 2` >/does/not/exist; echo $? | ||
17 | false; a=`exit 2` >/does/not/exist; echo $? | ||
18 | true; a=$(exit 2) >/does/not/exist; echo $? | ||
19 | false; a=$(exit 2) >/does/not/exist; echo $? | ||
diff --git a/shell/ash_test/ash-psubst/falsetick2.right b/shell/ash_test/ash-psubst/falsetick2.right new file mode 100644 index 000000000..670f560f1 --- /dev/null +++ b/shell/ash_test/ash-psubst/falsetick2.right | |||
@@ -0,0 +1 @@ | |||
Two:2 v:[] | |||
diff --git a/shell/ash_test/ash-psubst/falsetick2.tests b/shell/ash_test/ash-psubst/falsetick2.tests new file mode 100755 index 000000000..cfbd1a5de --- /dev/null +++ b/shell/ash_test/ash-psubst/falsetick2.tests | |||
@@ -0,0 +1,3 @@ | |||
1 | v=v | ||
2 | v=`exit 2` `false` | ||
3 | echo Two:$? v:"[$v]" | ||