diff options
author | Mark Whitley <markw@lineo.com> | 2001-05-24 17:15:33 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-05-24 17:15:33 +0000 |
commit | 04052f96e1385405787356f0955afadd73d8f029 (patch) | |
tree | 1a95bdf6e1e21bb031b872d032ba2ca0d0664757 /tests/sh.testcases | |
parent | a813afc24f864e0055bdd0ef8cde6777a514b212 (diff) | |
download | busybox-w32-04052f96e1385405787356f0955afadd73d8f029.tar.gz busybox-w32-04052f96e1385405787356f0955afadd73d8f029.tar.bz2 busybox-w32-04052f96e1385405787356f0955afadd73d8f029.zip |
Numerous new testcases from Larry Doolittle and a patch to tester.sh to avoid
a bash2-ism and quote variables that contain strings.
Diffstat (limited to 'tests/sh.testcases')
-rw-r--r-- | tests/sh.testcases | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/sh.testcases b/tests/sh.testcases new file mode 100644 index 000000000..85d72a200 --- /dev/null +++ b/tests/sh.testcases | |||
@@ -0,0 +1,33 @@ | |||
1 | # try running this with bash, ksh, ash, and hush. | ||
2 | echo `echo -e foo\\\necho bar` | ||
3 | |||
4 | echo THIS IS A TEST >foo | ||
5 | cat $(echo FOO | tr 'A-Z' 'a-z') | ||
6 | cat foo | tr 'A-Z' 'a-z' | ||
7 | cat $(echo FOO | tr 'A-Z' 'a-z') | tr 'A-Z' 'a-z' | ||
8 | |||
9 | cat foo | if true; then tr 'A-Z' 'a-z'; else echo bar1; fi | ||
10 | cat foo | if false; then tr 'A-Z' 'a-z'; else echo bar2; fi | ||
11 | if true; then tr 'A-Z' 'a-z'; else echo bar3; fi <foo | ||
12 | if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo | ||
13 | if true || false; then echo foo; else echo bar5; fi | ||
14 | if true && false; then echo bar6; else echo foo; fi | ||
15 | |||
16 | # ash, lash, and hush do not create fish; bash and ksh do. Tough. | ||
17 | # Thanks to Tapani Tarvainen <tt@mit.jyu.fi> for this stress test. | ||
18 | unset TMP | ||
19 | rm -f fish | ||
20 | TMP=fish >$TMP | ||
21 | ls fish | ||
22 | |||
23 | # The following example shows that hush's parser is | ||
24 | # not _really_ Bourne compatible | ||
25 | echo "echo Hello World" >"a=b" | ||
26 | unset a | ||
27 | chmod a+x "a=b" | ||
28 | PATH=$PATH:. | ||
29 | "a=b" | ||
30 | echo $a | ||
31 | |||
32 | # assuming the shell wasn't too buggy, clean up the mess | ||
33 | rm -f a=b fish foo | ||