aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-18 16:29:32 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-18 16:29:32 +0000
commitab876cd107fe6ca274f58bae3264396745d8e5f9 (patch)
treec94ecba9c7d10af007294333e9b4c80efe079cfb /shell/hush_test
parent985de15bf3f39b5e32e34cadaf6947708197f018 (diff)
downloadbusybox-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.right2
-rwxr-xr-xshell/hush_test/hush-glob/glob_redir.tests9
-rw-r--r--shell/hush_test/hush-parsing/escape3.right23
-rwxr-xr-xshell/hush_test/hush-parsing/escape3.tests8
-rw-r--r--shell/hush_test/hush-parsing/redir_space.right3
-rwxr-xr-xshell/hush_test/hush-parsing/redir_space.tests6
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 @@
1z.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
6echo TEST >?.tmp
7echo 'z.tmp:' `cat 'z.tmp'`
8echo '?.tmp:' `cat '?.tmp'`
9rm '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 @@
1v: a \ b \\ c \\\ d \\\\ e
2v: a \ b \\ c \\\ d \\\\ e
3Unquoted:
4.a.
5.\.
6.b.
7.\\.
8.c.
9.\\\.
10.d.
11.\\\\.
12.e.
13Quoted:
14.a.
15.\.
16.b.
17.\\.
18.c.
19.\\\.
20.d.
21.\\\\.
22.e.
23done
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 @@
1v='a \ b \\ c \\\ d \\\\ e'
2echo v: $v
3echo v: "$v"
4echo Unquoted:
5for a in $v; do echo .$a.; done
6echo Quoted:
7for a in $v; do echo ".$a."; done
8echo 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 @@
1z1.tmp: 1
2z2.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 @@
1v='z1.tmp z2.tmp'
2echo TEST >$v
3echo 'z1.tmp:' `cat 'z1.tmp' 2>/dev/null; echo $?`
4echo 'z2.tmp:' `cat 'z2.tmp' 2>/dev/null; echo $?`
5echo '"z1.tmp z2.tmp":' `cat 'z1.tmp z2.tmp' 2>/dev/null; echo $?`
6rm z*.tmp