aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-05-24 23:05:13 +0000
committerMark Whitley <markw@lineo.com>2001-05-24 23:05:13 +0000
commit4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b (patch)
tree4ae91b6883dfdfd2dbe59ab924e6c9a27ef476c8
parent8b7a0d807a3ec8cfcbc4e4cb3067237b438bae14 (diff)
downloadbusybox-w32-4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b.tar.gz
busybox-w32-4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b.tar.bz2
busybox-w32-4f6aea807b0cd411cbc6f9d3b79e8583d6bd532b.zip
More shell / quoting testcases from Larry.
-rw-r--r--tests/sh.testcases23
-rw-r--r--tests/testcases2
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.
4echo a b
5echo "a b"
6echo a "" b
7echo a '' b
8echo hello?
9echo "hello?"
10echo t* hello
11echo t\* hello
12
13# quick and painless exit for lash
14if false; then true; exit; fi
15
16# fairly simple command substitution
2echo `echo -e foo\\\necho bar` 17echo `echo -e foo\\\necho bar`
3 18
4echo THIS IS A TEST >foo 19echo THIS IS A TEST >foo
@@ -13,7 +28,13 @@ if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo
13if true || false; then echo foo; else echo bar5; fi 28if true || false; then echo foo; else echo bar5; fi
14if true && false; then echo bar6; else echo foo; fi 29if 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
32unset TMP
33rm -f fish
34TMP=fish && >$TMP
35ls 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.
18unset TMP 39unset TMP
19rm -f fish 40rm -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
306sh -c "echo a b c" 306sh -c "echo a b c"
307sh -c ">" 307sh -c ">"
308sh -c "a" 308sh -c "a"
309#sh sh.testcases 309sh sh.testcases
310 310
311 311
312# sleep - can't test: produces no output 312# sleep - can't test: produces no output