diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-05 15:15:53 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-05 15:15:53 +0200 |
commit | 21b7f1b6b67f191ca187910a5fd4cd2cb1eb5353 (patch) | |
tree | 3e9c5d63d0dd410b5fbd0eaf82cf051c105189a8 /shell/hush_test | |
parent | 41d8f1081378ec79586d59e7d2a31380b6f95577 (diff) | |
download | busybox-w32-21b7f1b6b67f191ca187910a5fd4cd2cb1eb5353.tar.gz busybox-w32-21b7f1b6b67f191ca187910a5fd4cd2cb1eb5353.tar.bz2 busybox-w32-21b7f1b6b67f191ca187910a5fd4cd2cb1eb5353.zip |
hush: fix a few more corner cases with empty-expanding `cmds`
See added testcases
function old new delta
run_pipe 1723 1784 +61
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-psubst/falsetick2.right | 1 | ||||
-rwxr-xr-x | shell/hush_test/hush-psubst/falsetick2.tests | 3 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir_backquote1.right | 11 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir_backquote1.tests | 19 |
4 files changed, 34 insertions, 0 deletions
diff --git a/shell/hush_test/hush-psubst/falsetick2.right b/shell/hush_test/hush-psubst/falsetick2.right new file mode 100644 index 000000000..670f560f1 --- /dev/null +++ b/shell/hush_test/hush-psubst/falsetick2.right | |||
@@ -0,0 +1 @@ | |||
Two:2 v:[] | |||
diff --git a/shell/hush_test/hush-psubst/falsetick2.tests b/shell/hush_test/hush-psubst/falsetick2.tests new file mode 100755 index 000000000..cfbd1a5de --- /dev/null +++ b/shell/hush_test/hush-psubst/falsetick2.tests | |||
@@ -0,0 +1,3 @@ | |||
1 | v=v | ||
2 | v=`exit 2` `false` | ||
3 | echo Two:$? v:"[$v]" | ||
diff --git a/shell/hush_test/hush-redir/redir_backquote1.right b/shell/hush_test/hush-redir/redir_backquote1.right new file mode 100644 index 000000000..810cc2314 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_backquote1.right | |||
@@ -0,0 +1,11 @@ | |||
1 | hush: can't open '/cant/be/created': No such file or directory | ||
2 | First | ||
3 | One:1 v1:[] | ||
4 | hush: can't open '/cant/be/created': No such file or directory | ||
5 | Second | ||
6 | One:1 v2:[] | ||
7 | Third | ||
8 | Zero:0 v3:[] | ||
9 | Fourth | ||
10 | Zero:0 v4:[] | ||
11 | Zero:0 v5:[1] | ||
diff --git a/shell/hush_test/hush-redir/redir_backquote1.tests b/shell/hush_test/hush-redir/redir_backquote1.tests new file mode 100755 index 000000000..41bb4913c --- /dev/null +++ b/shell/hush_test/hush-redir/redir_backquote1.tests | |||
@@ -0,0 +1,19 @@ | |||
1 | v=v | ||
2 | v=`echo First >&2` `` >/cant/be/created | ||
3 | echo One:$? v1:"[$v]" | ||
4 | |||
5 | v=v | ||
6 | v=`echo Second >&2` `true` >/cant/be/created | ||
7 | echo One:$? v2:"[$v]" | ||
8 | |||
9 | v=v | ||
10 | v=`echo Third >&2` `true` 2>/dev/null | ||
11 | echo Zero:$? v3:"[$v]" | ||
12 | |||
13 | v=v | ||
14 | v=`echo Fourth >&2` `false` 2>/dev/null | ||
15 | echo Zero:$? v4:"[$v]" | ||
16 | |||
17 | v=v | ||
18 | v=`echo $?` `false` 2>/dev/null | ||
19 | echo Zero:$? v5:"[$v]" | ||