aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-24 02:49:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-24 02:49:56 +0200
commite34dbc4fdcae6e21bb186c225f76d399d2656d75 (patch)
treeddca2d6cb7209bd34e6775c26e211e0c6f49d0e7
parent0675b03de44b75f5f5fc7a54c164628e9ee01e9c (diff)
downloadbusybox-w32-e34dbc4fdcae6e21bb186c225f76d399d2656d75.tar.gz
busybox-w32-e34dbc4fdcae6e21bb186c225f76d399d2656d75.tar.bz2
busybox-w32-e34dbc4fdcae6e21bb186c225f76d399d2656d75.zip
ash: add all hush parsing tests to ast tests
All pass. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash_test/ash-parsing/argv0.right1
-rwxr-xr-xshell/ash_test/ash-parsing/argv0.tests4
-rw-r--r--shell/ash_test/ash-parsing/brace1.right7
-rwxr-xr-xshell/ash_test/ash-parsing/brace1.tests7
-rw-r--r--shell/ash_test/ash-parsing/brace2.right3
-rwxr-xr-xshell/ash_test/ash-parsing/brace2.tests5
-rw-r--r--shell/ash_test/ash-parsing/comment1.right2
-rwxr-xr-xshell/ash_test/ash-parsing/comment1.tests2
-rw-r--r--shell/ash_test/ash-parsing/eol1.right1
-rwxr-xr-xshell/ash_test/ash-parsing/eol1.tests18
-rw-r--r--shell/ash_test/ash-parsing/escape1.right4
-rwxr-xr-xshell/ash_test/ash-parsing/escape1.tests6
-rw-r--r--shell/ash_test/ash-parsing/escape2.right4
-rwxr-xr-xshell/ash_test/ash-parsing/escape2.tests4
-rw-r--r--shell/ash_test/ash-parsing/escape3.right23
-rwxr-xr-xshell/ash_test/ash-parsing/escape3.tests10
-rw-r--r--shell/ash_test/ash-parsing/escape4.right2
-rwxr-xr-xshell/ash_test/ash-parsing/escape4.tests6
-rw-r--r--shell/ash_test/ash-parsing/escape5.right9
-rwxr-xr-xshell/ash_test/ash-parsing/escape5.tests7
-rw-r--r--shell/ash_test/ash-parsing/group1.right1
-rwxr-xr-xshell/ash_test/ash-parsing/group1.tests1
-rw-r--r--shell/ash_test/ash-parsing/group2.right2
-rwxr-xr-xshell/ash_test/ash-parsing/group2.tests3
-rw-r--r--shell/ash_test/ash-parsing/groups_and_keywords1.right11
-rwxr-xr-xshell/ash_test/ash-parsing/groups_and_keywords1.tests10
-rw-r--r--shell/ash_test/ash-parsing/negate.right36
-rwxr-xr-xshell/ash_test/ash-parsing/negate.tests19
-rw-r--r--shell/ash_test/ash-parsing/noeol.right1
-rwxr-xr-xshell/ash_test/ash-parsing/noeol.tests2
-rw-r--r--shell/ash_test/ash-parsing/noeol2.right1
-rwxr-xr-xshell/ash_test/ash-parsing/noeol2.tests7
-rw-r--r--shell/ash_test/ash-parsing/noeol3.right1
-rwxr-xr-xshell/ash_test/ash-parsing/noeol3.tests2
-rw-r--r--shell/ash_test/ash-parsing/process_subst.right3
-rwxr-xr-xshell/ash_test/ash-parsing/process_subst.tests3
-rw-r--r--shell/ash_test/ash-parsing/quote1.right1
-rwxr-xr-xshell/ash_test/ash-parsing/quote1.tests2
-rw-r--r--shell/ash_test/ash-parsing/quote2.right1
-rwxr-xr-xshell/ash_test/ash-parsing/quote2.tests2
-rw-r--r--shell/ash_test/ash-parsing/quote3.right12
-rwxr-xr-xshell/ash_test/ash-parsing/quote3.tests21
-rw-r--r--shell/ash_test/ash-parsing/quote4.right1
-rwxr-xr-xshell/ash_test/ash-parsing/quote4.tests2
-rw-r--r--shell/ash_test/ash-parsing/starquoted.right8
-rwxr-xr-xshell/ash_test/ash-parsing/starquoted.tests8
-rw-r--r--shell/ash_test/ash-parsing/starquoted2.right8
-rwxr-xr-xshell/ash_test/ash-parsing/starquoted2.tests19
-rwxr-xr-xshell/ash_test/run-all22
49 files changed, 331 insertions, 4 deletions
diff --git a/shell/ash_test/ash-parsing/argv0.right b/shell/ash_test/ash-parsing/argv0.right
new file mode 100644
index 000000000..d86bac9de
--- /dev/null
+++ b/shell/ash_test/ash-parsing/argv0.right
@@ -0,0 +1 @@
OK
diff --git a/shell/ash_test/ash-parsing/argv0.tests b/shell/ash_test/ash-parsing/argv0.tests
new file mode 100755
index 000000000..f5c40f6fe
--- /dev/null
+++ b/shell/ash_test/ash-parsing/argv0.tests
@@ -0,0 +1,4 @@
1if test $# = 0; then
2 exec "$THIS_SH" "$0" arg
3fi
4echo OK
diff --git a/shell/ash_test/ash-parsing/brace1.right b/shell/ash_test/ash-parsing/brace1.right
new file mode 100644
index 000000000..10aa7a419
--- /dev/null
+++ b/shell/ash_test/ash-parsing/brace1.right
@@ -0,0 +1,7 @@
1{abc}
2{
3}
4./brace1.tests: line 4: {cmd: not found
5./brace1.tests: line 5: {: not found
6./brace1.tests: line 6: {: not found
7Done: 127
diff --git a/shell/ash_test/ash-parsing/brace1.tests b/shell/ash_test/ash-parsing/brace1.tests
new file mode 100755
index 000000000..2b45927c0
--- /dev/null
+++ b/shell/ash_test/ash-parsing/brace1.tests
@@ -0,0 +1,7 @@
1echo {abc}
2echo {
3echo }
4{cmd
5""{
6{""
7echo Done: $?
diff --git a/shell/ash_test/ash-parsing/brace2.right b/shell/ash_test/ash-parsing/brace2.right
new file mode 100644
index 000000000..37a966654
--- /dev/null
+++ b/shell/ash_test/ash-parsing/brace2.right
@@ -0,0 +1,3 @@
1{q,w}
2{q,w}
3Done
diff --git a/shell/ash_test/ash-parsing/brace2.tests b/shell/ash_test/ash-parsing/brace2.tests
new file mode 100755
index 000000000..ef75f0b70
--- /dev/null
+++ b/shell/ash_test/ash-parsing/brace2.tests
@@ -0,0 +1,5 @@
1v='{q,w}'
2# Should not brace-expand v value
3echo $v
4echo "$v"
5echo Done
diff --git a/shell/ash_test/ash-parsing/comment1.right b/shell/ash_test/ash-parsing/comment1.right
new file mode 100644
index 000000000..a102b1d4e
--- /dev/null
+++ b/shell/ash_test/ash-parsing/comment1.right
@@ -0,0 +1,2 @@
1Nothing:
2String: #should-be-echoed
diff --git a/shell/ash_test/ash-parsing/comment1.tests b/shell/ash_test/ash-parsing/comment1.tests
new file mode 100755
index 000000000..d268860ff
--- /dev/null
+++ b/shell/ash_test/ash-parsing/comment1.tests
@@ -0,0 +1,2 @@
1echo Nothing: #should-not-be-echoed
2echo String: ""#should-be-echoed
diff --git a/shell/ash_test/ash-parsing/eol1.right b/shell/ash_test/ash-parsing/eol1.right
new file mode 100644
index 000000000..31c896f62
--- /dev/null
+++ b/shell/ash_test/ash-parsing/eol1.right
@@ -0,0 +1 @@
Done:0
diff --git a/shell/ash_test/ash-parsing/eol1.tests b/shell/ash_test/ash-parsing/eol1.tests
new file mode 100755
index 000000000..f1b55e8b8
--- /dev/null
+++ b/shell/ash_test/ash-parsing/eol1.tests
@@ -0,0 +1,18 @@
1# bug was that we treated <newline> as ';' in this line:
2true || echo foo |
3echo BAD1 | cat
4
5# variation on the same theme
6true || echo foo |
7# comment
8echo BAD2 | cat
9
10# variation on the same theme
11true || echo foo |
12
13echo BAD3 | cat
14
15# this should error out, but currently works in hush:
16#true || echo foo |;
17
18echo Done:$?
diff --git a/shell/ash_test/ash-parsing/escape1.right b/shell/ash_test/ash-parsing/escape1.right
new file mode 100644
index 000000000..1899b87ef
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape1.right
@@ -0,0 +1,4 @@
1\
2a\b
3\\
4c\\d
diff --git a/shell/ash_test/ash-parsing/escape1.tests b/shell/ash_test/ash-parsing/escape1.tests
new file mode 100755
index 000000000..25ac96b25
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape1.tests
@@ -0,0 +1,6 @@
1test "$CONFIG_FEATURE_FANCY_ECHO" = "y" || exit 77
2
3echo "\\"
4echo a"\\"b
5echo '\\'
6echo c'\\'d
diff --git a/shell/ash_test/ash-parsing/escape2.right b/shell/ash_test/ash-parsing/escape2.right
new file mode 100644
index 000000000..f55fd4a42
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape2.right
@@ -0,0 +1,4 @@
1*?[a]*
2a*?[a]*b
3*?[a]*
4c*?[a]*d
diff --git a/shell/ash_test/ash-parsing/escape2.tests b/shell/ash_test/ash-parsing/escape2.tests
new file mode 100755
index 000000000..ee718018d
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape2.tests
@@ -0,0 +1,4 @@
1echo "*?[a]*"
2echo a"*?[a]*"b
3echo '*?[a]*'
4echo c'*?[a]*'d
diff --git a/shell/ash_test/ash-parsing/escape3.right b/shell/ash_test/ash-parsing/escape3.right
new file mode 100644
index 000000000..da02a976a
--- /dev/null
+++ b/shell/ash_test/ash-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/ash_test/ash-parsing/escape3.tests b/shell/ash_test/ash-parsing/escape3.tests
new file mode 100755
index 000000000..18705bd0c
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape3.tests
@@ -0,0 +1,10 @@
1test "$CONFIG_FEATURE_FANCY_ECHO" = "y" || exit 77
2
3v='a \ b \\ c \\\ d \\\\ e'
4echo v: $v
5echo v: "$v"
6echo Unquoted:
7for a in $v; do echo .$a.; done
8echo Quoted:
9for a in $v; do echo ".$a."; done
10echo done
diff --git a/shell/ash_test/ash-parsing/escape4.right b/shell/ash_test/ash-parsing/escape4.right
new file mode 100644
index 000000000..5de3e0c90
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape4.right
@@ -0,0 +1,2 @@
1Ok
2End
diff --git a/shell/ash_test/ash-parsing/escape4.tests b/shell/ash_test/ash-parsing/escape4.tests
new file mode 100755
index 000000000..df8bf0af7
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape4.tests
@@ -0,0 +1,6 @@
1i\
2f tr\
3ue; th\
4en echo "O\
5k"; fi; echo "\
6End" \ No newline at end of file
diff --git a/shell/ash_test/ash-parsing/escape5.right b/shell/ash_test/ash-parsing/escape5.right
new file mode 100644
index 000000000..3cdd393c7
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape5.right
@@ -0,0 +1,9 @@
1a\nb\nc\n
2a
3b
4c
5a\nb\nc\n
6a
7b
8c
9Done
diff --git a/shell/ash_test/ash-parsing/escape5.tests b/shell/ash_test/ash-parsing/escape5.tests
new file mode 100755
index 000000000..337a98ec7
--- /dev/null
+++ b/shell/ash_test/ash-parsing/escape5.tests
@@ -0,0 +1,7 @@
1v="a\nb\nc\n"
2echo "$v"
3printf "$v"
4v='a\nb\nc\n'
5echo "$v"
6printf "$v"
7echo Done
diff --git a/shell/ash_test/ash-parsing/group1.right b/shell/ash_test/ash-parsing/group1.right
new file mode 100644
index 000000000..6a7c4be0a
--- /dev/null
+++ b/shell/ash_test/ash-parsing/group1.right
@@ -0,0 +1 @@
word} }
diff --git a/shell/ash_test/ash-parsing/group1.tests b/shell/ash_test/ash-parsing/group1.tests
new file mode 100755
index 000000000..f063fbcb3
--- /dev/null
+++ b/shell/ash_test/ash-parsing/group1.tests
@@ -0,0 +1 @@
{ echo word} }; }
diff --git a/shell/ash_test/ash-parsing/group2.right b/shell/ash_test/ash-parsing/group2.right
new file mode 100644
index 000000000..df4d9306a
--- /dev/null
+++ b/shell/ash_test/ash-parsing/group2.right
@@ -0,0 +1,2 @@
1got TERM
2Done: 0
diff --git a/shell/ash_test/ash-parsing/group2.tests b/shell/ash_test/ash-parsing/group2.tests
new file mode 100755
index 000000000..d99178585
--- /dev/null
+++ b/shell/ash_test/ash-parsing/group2.tests
@@ -0,0 +1,3 @@
1# Bug was in handling of "}&" without space
2{ trap "echo got TERM" TERM; sleep 2; }& sleep 1; kill $!; wait
3echo Done: $?
diff --git a/shell/ash_test/ash-parsing/groups_and_keywords1.right b/shell/ash_test/ash-parsing/groups_and_keywords1.right
new file mode 100644
index 000000000..4c46650dc
--- /dev/null
+++ b/shell/ash_test/ash-parsing/groups_and_keywords1.right
@@ -0,0 +1,11 @@
1Semicolons after } can be omitted 1:
2foo
3bar
4Semicolons after } can be omitted 2:
5foo
6bar
7Semicolons after fi can be omitted:
8foo
9bar
10baz
11Done:0
diff --git a/shell/ash_test/ash-parsing/groups_and_keywords1.tests b/shell/ash_test/ash-parsing/groups_and_keywords1.tests
new file mode 100755
index 000000000..01944d714
--- /dev/null
+++ b/shell/ash_test/ash-parsing/groups_and_keywords1.tests
@@ -0,0 +1,10 @@
1echo "Semicolons after } can be omitted 1:"
2if { echo foo; } then { echo bar; } fi
3
4echo "Semicolons after } can be omitted 2:"
5while { echo foo; } do { echo bar; break; } done
6
7echo "Semicolons after fi can be omitted:"
8while if echo foo; then echo bar; fi do echo baz; break; done
9
10echo Done:$?
diff --git a/shell/ash_test/ash-parsing/negate.right b/shell/ash_test/ash-parsing/negate.right
new file mode 100644
index 000000000..61d2ecd3a
--- /dev/null
+++ b/shell/ash_test/ash-parsing/negate.right
@@ -0,0 +1,36 @@
1! printing !
20
31
41
50
60
70
8!
9a
10b
11c
12! 1
13a 1
14b 1
15c 1
16! 1
17a 1
18b 1
19c 1
200
210
220
230
241
251
261
271
280
290
300
310
321
331
341
351
36Done
diff --git a/shell/ash_test/ash-parsing/negate.tests b/shell/ash_test/ash-parsing/negate.tests
new file mode 100755
index 000000000..51151cbd4
--- /dev/null
+++ b/shell/ash_test/ash-parsing/negate.tests
@@ -0,0 +1,19 @@
1echo ! printing !
2! false
3echo $?
4! true
5echo $?
6if ! false; then false; echo $?; fi
7echo $?
8if ! false; then ! false; echo $?; fi
9echo $?
10PRINTF=`which printf`
11for a in ! a b c; do echo $a; done
12for a in ! a b c; do ! printf "$a "; echo $?; done
13test x"$PRINTF" = x"" && exit 1
14for a in ! a b c; do ! "$PRINTF" "$a "; echo $?; done
15for a in ! a b c; do ! printf "$a " | false; echo $?; done
16for a in ! a b c; do ! printf "$a " | true; echo $?; done
17for a in ! a b c; do ! { printf "$a " | false; }; echo $?; done
18for a in ! a b c; do ! { printf "$a " | true; }; echo $?; done
19echo Done
diff --git a/shell/ash_test/ash-parsing/noeol.right b/shell/ash_test/ash-parsing/noeol.right
new file mode 100644
index 000000000..e427984d4
--- /dev/null
+++ b/shell/ash_test/ash-parsing/noeol.right
@@ -0,0 +1 @@
HELLO
diff --git a/shell/ash_test/ash-parsing/noeol.tests b/shell/ash_test/ash-parsing/noeol.tests
new file mode 100755
index 000000000..a93113a03
--- /dev/null
+++ b/shell/ash_test/ash-parsing/noeol.tests
@@ -0,0 +1,2 @@
1# next line has no EOL!
2echo HELLO \ No newline at end of file
diff --git a/shell/ash_test/ash-parsing/noeol2.right b/shell/ash_test/ash-parsing/noeol2.right
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/shell/ash_test/ash-parsing/noeol2.right
@@ -0,0 +1 @@
1
diff --git a/shell/ash_test/ash-parsing/noeol2.tests b/shell/ash_test/ash-parsing/noeol2.tests
new file mode 100755
index 000000000..1220f056f
--- /dev/null
+++ b/shell/ash_test/ash-parsing/noeol2.tests
@@ -0,0 +1,7 @@
1# last line has no EOL!
2if true
3then
4 echo 1
5else
6 echo 2
7fi \ No newline at end of file
diff --git a/shell/ash_test/ash-parsing/noeol3.right b/shell/ash_test/ash-parsing/noeol3.right
new file mode 100644
index 000000000..c2a0e38f8
--- /dev/null
+++ b/shell/ash_test/ash-parsing/noeol3.right
@@ -0,0 +1 @@
./noeol3.tests: line 2: syntax error: unterminated quoted string
diff --git a/shell/ash_test/ash-parsing/noeol3.tests b/shell/ash_test/ash-parsing/noeol3.tests
new file mode 100755
index 000000000..ec958ed7a
--- /dev/null
+++ b/shell/ash_test/ash-parsing/noeol3.tests
@@ -0,0 +1,2 @@
1# last line has no EOL!
2echo "unterminated \ No newline at end of file
diff --git a/shell/ash_test/ash-parsing/process_subst.right b/shell/ash_test/ash-parsing/process_subst.right
new file mode 100644
index 000000000..397bc8067
--- /dev/null
+++ b/shell/ash_test/ash-parsing/process_subst.right
@@ -0,0 +1,3 @@
1TESTzzBEST
2TEST$(echo zz)BEST
3TEST'BEST
diff --git a/shell/ash_test/ash-parsing/process_subst.tests b/shell/ash_test/ash-parsing/process_subst.tests
new file mode 100755
index 000000000..21996bc0e
--- /dev/null
+++ b/shell/ash_test/ash-parsing/process_subst.tests
@@ -0,0 +1,3 @@
1echo "TEST`echo zz;echo;echo`BEST"
2echo "TEST`echo '$(echo zz)'`BEST"
3echo "TEST`echo "'"`BEST"
diff --git a/shell/ash_test/ash-parsing/quote1.right b/shell/ash_test/ash-parsing/quote1.right
new file mode 100644
index 000000000..cb382054c
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote1.right
@@ -0,0 +1 @@
'1'
diff --git a/shell/ash_test/ash-parsing/quote1.tests b/shell/ash_test/ash-parsing/quote1.tests
new file mode 100755
index 000000000..f55895466
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote1.tests
@@ -0,0 +1,2 @@
1a=1
2echo "'$a'"
diff --git a/shell/ash_test/ash-parsing/quote2.right b/shell/ash_test/ash-parsing/quote2.right
new file mode 100644
index 000000000..3bc9edcd6
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote2.right
@@ -0,0 +1 @@
>1
diff --git a/shell/ash_test/ash-parsing/quote2.tests b/shell/ash_test/ash-parsing/quote2.tests
new file mode 100755
index 000000000..bd966f30b
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote2.tests
@@ -0,0 +1,2 @@
1a=1
2echo ">$a"
diff --git a/shell/ash_test/ash-parsing/quote3.right b/shell/ash_test/ash-parsing/quote3.right
new file mode 100644
index 000000000..bbe46df67
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote3.right
@@ -0,0 +1,12 @@
1Testing: in ""
2..
3Testing: in ''
4..
5Testing: in $empty
6Testing: in $empty""
7..
8Testing: in $empty''
9..
10Testing: in "$empty"
11..
12Finished
diff --git a/shell/ash_test/ash-parsing/quote3.tests b/shell/ash_test/ash-parsing/quote3.tests
new file mode 100755
index 000000000..b5fd5978c
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote3.tests
@@ -0,0 +1,21 @@
1empty=''
2
3echo 'Testing: in ""'
4for a in ""; do echo ".$a."; done
5
6echo 'Testing: in '"''"
7for a in ''; do echo ".$a."; done
8
9echo 'Testing: in $empty'
10for a in $empty; do echo ".$a."; done
11
12echo 'Testing: in $empty""'
13for a in $empty""; do echo ".$a."; done
14
15echo 'Testing: in $empty'"''"
16for a in $empty''; do echo ".$a."; done
17
18echo 'Testing: in "$empty"'
19for a in "$empty"; do echo ".$a."; done
20
21echo Finished
diff --git a/shell/ash_test/ash-parsing/quote4.right b/shell/ash_test/ash-parsing/quote4.right
new file mode 100644
index 000000000..b2901ea97
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote4.right
@@ -0,0 +1 @@
a b
diff --git a/shell/ash_test/ash-parsing/quote4.tests b/shell/ash_test/ash-parsing/quote4.tests
new file mode 100755
index 000000000..f1dabfa54
--- /dev/null
+++ b/shell/ash_test/ash-parsing/quote4.tests
@@ -0,0 +1,2 @@
1a_b='a b'
2echo "$a_b"
diff --git a/shell/ash_test/ash-parsing/starquoted.right b/shell/ash_test/ash-parsing/starquoted.right
new file mode 100644
index 000000000..b56323fe1
--- /dev/null
+++ b/shell/ash_test/ash-parsing/starquoted.right
@@ -0,0 +1,8 @@
1.1 abc d e f.
2.1.
3.abc.
4.d e f.
5.-1 abc d e f-.
6.-1.
7.abc.
8.d e f-.
diff --git a/shell/ash_test/ash-parsing/starquoted.tests b/shell/ash_test/ash-parsing/starquoted.tests
new file mode 100755
index 000000000..2fe49b1cd
--- /dev/null
+++ b/shell/ash_test/ash-parsing/starquoted.tests
@@ -0,0 +1,8 @@
1if test $# = 0; then
2 exec "$THIS_SH" "$0" 1 abc 'd e f'
3fi
4
5for a in "$*"; do echo ".$a."; done
6for a in "$@"; do echo ".$a."; done
7for a in "-$*-"; do echo ".$a."; done
8for a in "-$@-"; do echo ".$a."; done
diff --git a/shell/ash_test/ash-parsing/starquoted2.right b/shell/ash_test/ash-parsing/starquoted2.right
new file mode 100644
index 000000000..1bff408ca
--- /dev/null
+++ b/shell/ash_test/ash-parsing/starquoted2.right
@@ -0,0 +1,8 @@
1Should be printed
2Would not be printed by bash
3Would not be printed by bash
4Would not be printed by bash
5Should be printed
6Empty:
7Empty:
8Empty:
diff --git a/shell/ash_test/ash-parsing/starquoted2.tests b/shell/ash_test/ash-parsing/starquoted2.tests
new file mode 100755
index 000000000..7c5ff45b8
--- /dev/null
+++ b/shell/ash_test/ash-parsing/starquoted2.tests
@@ -0,0 +1,19 @@
1if test $# != 0; then
2 exec "$THIS_SH" "$0"
3fi
4
5# No params!
6for a in "$*"; do echo Should be printed; done
7for a in "$@"; do echo Should not be printed; done
8# Yes, believe it or not, bash is mesmerized by "$@" and stops
9# treating "" as "this word cannot be expanded to nothing,
10# but must be at least null string". Now it can be expanded to nothing.
11for a in "$@"""; do echo Would not be printed by bash; done
12for a in """$@"; do echo Would not be printed by bash; done
13for a in """$@"''"$@"''; do echo Would not be printed by bash; done
14for a in ""; do echo Should be printed; done
15
16# Bug 207: "$@" expands to nothing, and we erroneously glob "%s\n" twice:
17printf 'Empty:%s\n' "$@"
18printf "Empty:%s\n" "$@"
19printf "Empty:%s\\n" "$@"
diff --git a/shell/ash_test/run-all b/shell/ash_test/run-all
index 983e6d184..caf033577 100755
--- a/shell/ash_test/run-all
+++ b/shell/ash_test/run-all
@@ -2,10 +2,24 @@
2 2
3TOPDIR=`pwd` 3TOPDIR=`pwd`
4 4
5test -x ash || { 5if test ! -x ash; then
6 echo "No ./ash - creating a link to ../../busybox" 6 if test ! -x ../../busybox; then
7 ln -s ../../busybox ash 7 echo "Can't run tests. Put ash binary into this directory (`pwd`)"
8} 8 exit 1
9 fi
10 echo "No ./ash - creating a link to ../../busybox"
11 ln -s ../../busybox ash
12fi
13if test ! -f .config; then
14 if test ! -f ../../.config; then
15 echo "Missing .config file"
16 exit 1
17 fi
18 cp ../../.config . || exit 1
19fi
20
21eval $(sed -e '/^#/d' -e '/^$/d' -e 's:^:export :' .config)
22
9test -x printenv || gcc -O2 -o printenv printenv.c || exit $? 23test -x printenv || gcc -O2 -o printenv printenv.c || exit $?
10test -x recho || gcc -O2 -o recho recho.c || exit $? 24test -x recho || gcc -O2 -o recho recho.c || exit $?
11test -x zecho || gcc -O2 -o zecho zecho.c || exit $? 25test -x zecho || gcc -O2 -o zecho zecho.c || exit $?