diff options
author | Mark Whitley <markw@lineo.com> | 2001-05-24 23:05:13 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-05-24 23:05:13 +0000 |
commit | 4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b (patch) | |
tree | 4ae91b6883dfdfd2dbe59ab924e6c9a27ef476c8 | |
parent | 8b7a0d807a3ec8cfcbc4e4cb3067237b438bae14 (diff) | |
download | busybox-w32-4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b.tar.gz busybox-w32-4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b.tar.bz2 busybox-w32-4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b.zip |
More shell / quoting testcases from Larry.
-rw-r--r-- | tests/sh.testcases | 23 | ||||
-rw-r--r-- | tests/testcases | 2 |
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/sh.testcases b/tests/sh.testcases index 85d72a200..9b5c8da59 100644 --- a/tests/sh.testcases +++ b/tests/sh.testcases | |||
@@ -1,4 +1,19 @@ | |||
1 | # try running this with bash, ksh, ash, and hush. | 1 | # try running this with bash, ksh, ash, and hush. |
2 | |||
3 | # simple quoting rules. | ||
4 | echo a b | ||
5 | echo "a b" | ||
6 | echo a "" b | ||
7 | echo a '' b | ||
8 | echo hello? | ||
9 | echo "hello?" | ||
10 | echo t* hello | ||
11 | echo t\* hello | ||
12 | |||
13 | # quick and painless exit for lash | ||
14 | if false; then true; exit; fi | ||
15 | |||
16 | # fairly simple command substitution | ||
2 | echo `echo -e foo\\\necho bar` | 17 | echo `echo -e foo\\\necho bar` |
3 | 18 | ||
4 | echo THIS IS A TEST >foo | 19 | echo THIS IS A TEST >foo |
@@ -13,7 +28,13 @@ if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo | |||
13 | if true || false; then echo foo; else echo bar5; fi | 28 | if true || false; then echo foo; else echo bar5; fi |
14 | if true && false; then echo bar6; else echo foo; fi | 29 | if true && false; then echo bar6; else echo foo; fi |
15 | 30 | ||
16 | # ash, lash, and hush do not create fish; bash and ksh do. Tough. | 31 | # fairly simple example of hush expanding variables too early |
32 | unset TMP | ||
33 | rm -f fish | ||
34 | TMP=fish && >$TMP | ||
35 | ls fish | ||
36 | |||
37 | # ash, lash, and hush do not create fish; bash and ksh do. | ||
17 | # Thanks to Tapani Tarvainen <tt@mit.jyu.fi> for this stress test. | 38 | # Thanks to Tapani Tarvainen <tt@mit.jyu.fi> for this stress test. |
18 | unset TMP | 39 | unset TMP |
19 | rm -f fish | 40 | rm -f fish |
diff --git a/tests/testcases b/tests/testcases index 64d406a8a..5043c309e 100644 --- a/tests/testcases +++ b/tests/testcases | |||
@@ -306,7 +306,7 @@ sed -e '/test/s/dangerous/PELIGROSO/' testcases | |||
306 | sh -c "echo a b c" | 306 | sh -c "echo a b c" |
307 | sh -c ">" | 307 | sh -c ">" |
308 | sh -c "a" | 308 | sh -c "a" |
309 | #sh sh.testcases | 309 | sh sh.testcases |
310 | 310 | ||
311 | 311 | ||
312 | # sleep - can't test: produces no output | 312 | # sleep - can't test: produces no output |