diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-02 18:32:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-02 18:32:52 +0200 |
commit | df303ae11731b07f63b7034a7c141931d7a6fcbb (patch) | |
tree | 39daf30ce526ee9d9cfb1ebe8326bd13588d8942 /shell/ash_test | |
parent | c7a774dde4b777126de5ef9f718b503a15bf4d30 (diff) | |
download | busybox-w32-df303ae11731b07f63b7034a7c141931d7a6fcbb.tar.gz busybox-w32-df303ae11731b07f63b7034a7c141931d7a6fcbb.tar.bz2 busybox-w32-df303ae11731b07f63b7034a7c141931d7a6fcbb.zip |
sh testsuite: sync ash-redir/ and hush-redir/
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-redir/redir_escapednum.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir_escapednum.tests | 2 | ||||
-rw-r--r-- | shell/ash_test/ash-redir/redir_expand.right | 18 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir_expand.tests | 85 | ||||
-rw-r--r-- | shell/ash_test/ash-redir/redir_multi.right | 4 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir_multi.tests | 5 |
6 files changed, 115 insertions, 0 deletions
diff --git a/shell/ash_test/ash-redir/redir_escapednum.right b/shell/ash_test/ash-redir/redir_escapednum.right new file mode 100644 index 000000000..7326d9603 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_escapednum.right | |||
@@ -0,0 +1 @@ | |||
Ok | |||
diff --git a/shell/ash_test/ash-redir/redir_escapednum.tests b/shell/ash_test/ash-redir/redir_escapednum.tests new file mode 100755 index 000000000..81983cae2 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_escapednum.tests | |||
@@ -0,0 +1,2 @@ | |||
1 | echo NOT SHOWN \2>/dev/null | ||
2 | echo Ok | ||
diff --git a/shell/ash_test/ash-redir/redir_expand.right b/shell/ash_test/ash-redir/redir_expand.right new file mode 100644 index 000000000..ead25f603 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_expand.right | |||
@@ -0,0 +1,18 @@ | |||
1 | shell_test | ||
2 | \shell_test | ||
3 | \shell_test | ||
4 | \shell_test | ||
5 | Here1 | ||
6 | Ok1 | ||
7 | Here2 | ||
8 | Ok2 | ||
9 | Here3 | ||
10 | Ok3 | ||
11 | Here4 | ||
12 | Ok4 | ||
13 | Now with variable refs | ||
14 | shell_test_1 | ||
15 | \shell_test_1 | ||
16 | \shell_test_1 | ||
17 | \shell_test_1 | ||
18 | Done | ||
diff --git a/shell/ash_test/ash-redir/redir_expand.tests b/shell/ash_test/ash-redir/redir_expand.tests new file mode 100755 index 000000000..c50b8cedf --- /dev/null +++ b/shell/ash_test/ash-redir/redir_expand.tests | |||
@@ -0,0 +1,85 @@ | |||
1 | rm *shell_test* 2>/dev/null | ||
2 | |||
3 | >\shell_test | ||
4 | echo *shell_test* | ||
5 | rm *shell_test* | ||
6 | |||
7 | >\\shell_test | ||
8 | echo *shell_test* | ||
9 | rm *shell_test* | ||
10 | |||
11 | >"\shell_test" | ||
12 | echo *shell_test* | ||
13 | rm *shell_test* | ||
14 | |||
15 | >"\\shell_test" | ||
16 | echo *shell_test* | ||
17 | rm *shell_test* | ||
18 | |||
19 | |||
20 | cat <<\shell_test | ||
21 | Here1 | ||
22 | shell_test | ||
23 | echo Ok1 | ||
24 | |||
25 | cat <<\\shell_test | ||
26 | Here2 | ||
27 | \shell_test | ||
28 | echo Ok2 | ||
29 | |||
30 | cat <<"\shell_test" | ||
31 | Here3 | ||
32 | \shell_test | ||
33 | echo Ok3 | ||
34 | |||
35 | cat <<"\\shell_test" | ||
36 | Here4 | ||
37 | \shell_test | ||
38 | echo Ok4 | ||
39 | |||
40 | |||
41 | echo Now with variable refs | ||
42 | i=1 | ||
43 | |||
44 | |||
45 | >\shell_test_$i | ||
46 | echo *shell_test* | ||
47 | rm *shell_test* | ||
48 | |||
49 | >\\shell_test_$i | ||
50 | echo *shell_test* | ||
51 | rm *shell_test* | ||
52 | |||
53 | >"\shell_test_$i" | ||
54 | echo *shell_test* | ||
55 | rm *shell_test* | ||
56 | |||
57 | >"\\shell_test_$i" | ||
58 | echo *shell_test* | ||
59 | rm *shell_test* | ||
60 | |||
61 | echo Done;exit | ||
62 | # UNFIXED BUG. bash apparently will expand $i even in terminating delimiter. | ||
63 | # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html | ||
64 | # does not mandate this behavior. | ||
65 | # This is not likely to be used much in real-world. | ||
66 | |||
67 | cat <<\shell_test_$i | ||
68 | Here1 | ||
69 | shell_test_$i | ||
70 | echo Ok1 | ||
71 | |||
72 | cat <<\\shell_test_$i | ||
73 | Here2 | ||
74 | \shell_test_$i | ||
75 | echo Ok2 | ||
76 | |||
77 | cat <<"\shell_test_$i" | ||
78 | Here3 | ||
79 | \shell_test_$i | ||
80 | echo Ok3 | ||
81 | |||
82 | cat <<"\\shell_test_$i" | ||
83 | Here4 | ||
84 | \shell_test_$i | ||
85 | echo Ok4 | ||
diff --git a/shell/ash_test/ash-redir/redir_multi.right b/shell/ash_test/ash-redir/redir_multi.right new file mode 100644 index 000000000..a97c4bdf1 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_multi.right | |||
@@ -0,0 +1,4 @@ | |||
1 | Testing multiple redirections to same fd | ||
2 | Hello | ||
3 | Done1 | ||
4 | Done2 | ||
diff --git a/shell/ash_test/ash-redir/redir_multi.tests b/shell/ash_test/ash-redir/redir_multi.tests new file mode 100755 index 000000000..c639ebb2d --- /dev/null +++ b/shell/ash_test/ash-redir/redir_multi.tests | |||
@@ -0,0 +1,5 @@ | |||
1 | echo "Testing multiple redirections to same fd" | ||
2 | # bug was making us lose fd #1 after this: | ||
3 | echo Hello >/dev/null 1>&2 | ||
4 | echo Done1 | ||
5 | echo Done2 >&2 | ||