summaryrefslogtreecommitdiff
path: root/tests/sh.testcases
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-05-24 17:15:33 +0000
committerMark Whitley <markw@lineo.com>2001-05-24 17:15:33 +0000
commit04052f96e1385405787356f0955afadd73d8f029 (patch)
tree1a95bdf6e1e21bb031b872d032ba2ca0d0664757 /tests/sh.testcases
parenta813afc24f864e0055bdd0ef8cde6777a514b212 (diff)
downloadbusybox-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.testcases33
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.
2echo `echo -e foo\\\necho bar`
3
4echo THIS IS A TEST >foo
5cat $(echo FOO | tr 'A-Z' 'a-z')
6cat foo | tr 'A-Z' 'a-z'
7cat $(echo FOO | tr 'A-Z' 'a-z') | tr 'A-Z' 'a-z'
8
9cat foo | if true; then tr 'A-Z' 'a-z'; else echo bar1; fi
10cat foo | if false; then tr 'A-Z' 'a-z'; else echo bar2; fi
11if true; then tr 'A-Z' 'a-z'; else echo bar3; fi <foo
12if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo
13if true || false; then echo foo; else echo bar5; fi
14if 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.
18unset TMP
19rm -f fish
20TMP=fish >$TMP
21ls fish
22
23# The following example shows that hush's parser is
24# not _really_ Bourne compatible
25echo "echo Hello World" >"a=b"
26unset a
27chmod a+x "a=b"
28PATH=$PATH:.
29"a=b"
30echo $a
31
32# assuming the shell wasn't too buggy, clean up the mess
33rm -f a=b fish foo