diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-18 16:29:32 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-18 16:29:32 +0000 |
commit | ab876cd107fe6ca274f58bae3264396745d8e5f9 (patch) | |
tree | c94ecba9c7d10af007294333e9b4c80efe079cfb /shell/hush_test | |
parent | 985de15bf3f39b5e32e34cadaf6947708197f018 (diff) | |
download | busybox-w32-ab876cd107fe6ca274f58bae3264396745d8e5f9.tar.gz busybox-w32-ab876cd107fe6ca274f58bae3264396745d8e5f9.tar.bz2 busybox-w32-ab876cd107fe6ca274f58bae3264396745d8e5f9.zip |
hush: add testsuite for "no globbing in redirection" rule.
simplify redirection habdling
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-glob/glob_redir.right | 2 | ||||
-rwxr-xr-x | shell/hush_test/hush-glob/glob_redir.tests | 9 | ||||
-rw-r--r-- | shell/hush_test/hush-parsing/escape3.right | 23 | ||||
-rwxr-xr-x | shell/hush_test/hush-parsing/escape3.tests | 8 | ||||
-rw-r--r-- | shell/hush_test/hush-parsing/redir_space.right | 3 | ||||
-rwxr-xr-x | shell/hush_test/hush-parsing/redir_space.tests | 6 |
6 files changed, 51 insertions, 0 deletions
diff --git a/shell/hush_test/hush-glob/glob_redir.right b/shell/hush_test/hush-glob/glob_redir.right new file mode 100644 index 000000000..fbd0309b0 --- /dev/null +++ b/shell/hush_test/hush-glob/glob_redir.right | |||
@@ -0,0 +1,2 @@ | |||
1 | z.tmp: | ||
2 | ?.tmp: TEST | ||
diff --git a/shell/hush_test/hush-glob/glob_redir.tests b/shell/hush_test/hush-glob/glob_redir.tests new file mode 100755 index 000000000..621d12017 --- /dev/null +++ b/shell/hush_test/hush-glob/glob_redir.tests | |||
@@ -0,0 +1,9 @@ | |||
1 | # Redirections are not globbed. | ||
2 | # bash: | ||
3 | # if run as "sh", they are not globbed, but | ||
4 | # if run as "bash", they are! | ||
5 | >z.tmp | ||
6 | echo TEST >?.tmp | ||
7 | echo 'z.tmp:' `cat 'z.tmp'` | ||
8 | echo '?.tmp:' `cat '?.tmp'` | ||
9 | rm 'z.tmp' '?.tmp' | ||
diff --git a/shell/hush_test/hush-parsing/escape3.right b/shell/hush_test/hush-parsing/escape3.right new file mode 100644 index 000000000..da02a976a --- /dev/null +++ b/shell/hush_test/hush-parsing/escape3.right | |||
@@ -0,0 +1,23 @@ | |||
1 | v: a \ b \\ c \\\ d \\\\ e | ||
2 | v: a \ b \\ c \\\ d \\\\ e | ||
3 | Unquoted: | ||
4 | .a. | ||
5 | .\. | ||
6 | .b. | ||
7 | .\\. | ||
8 | .c. | ||
9 | .\\\. | ||
10 | .d. | ||
11 | .\\\\. | ||
12 | .e. | ||
13 | Quoted: | ||
14 | .a. | ||
15 | .\. | ||
16 | .b. | ||
17 | .\\. | ||
18 | .c. | ||
19 | .\\\. | ||
20 | .d. | ||
21 | .\\\\. | ||
22 | .e. | ||
23 | done | ||
diff --git a/shell/hush_test/hush-parsing/escape3.tests b/shell/hush_test/hush-parsing/escape3.tests new file mode 100755 index 000000000..111ed40a2 --- /dev/null +++ b/shell/hush_test/hush-parsing/escape3.tests | |||
@@ -0,0 +1,8 @@ | |||
1 | v='a \ b \\ c \\\ d \\\\ e' | ||
2 | echo v: $v | ||
3 | echo v: "$v" | ||
4 | echo Unquoted: | ||
5 | for a in $v; do echo .$a.; done | ||
6 | echo Quoted: | ||
7 | for a in $v; do echo ".$a."; done | ||
8 | echo done | ||
diff --git a/shell/hush_test/hush-parsing/redir_space.right b/shell/hush_test/hush-parsing/redir_space.right new file mode 100644 index 000000000..084295204 --- /dev/null +++ b/shell/hush_test/hush-parsing/redir_space.right | |||
@@ -0,0 +1,3 @@ | |||
1 | z1.tmp: 1 | ||
2 | z2.tmp: 1 | ||
3 | "z1.tmp z2.tmp": TEST 0 | ||
diff --git a/shell/hush_test/hush-parsing/redir_space.tests b/shell/hush_test/hush-parsing/redir_space.tests new file mode 100755 index 000000000..c0b543098 --- /dev/null +++ b/shell/hush_test/hush-parsing/redir_space.tests | |||
@@ -0,0 +1,6 @@ | |||
1 | v='z1.tmp z2.tmp' | ||
2 | echo TEST >$v | ||
3 | echo 'z1.tmp:' `cat 'z1.tmp' 2>/dev/null; echo $?` | ||
4 | echo 'z2.tmp:' `cat 'z2.tmp' 2>/dev/null; echo $?` | ||
5 | echo '"z1.tmp z2.tmp":' `cat 'z1.tmp z2.tmp' 2>/dev/null; echo $?` | ||
6 | rm z*.tmp | ||