aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-07 16:42:05 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-07 16:42:05 +0000
commitdeb80875c85869db51883249f66ca92edca00bb9 (patch)
tree26d6ed9beac36d72c4423ae6eddfdd7bf31a43c4 /tests
parente8c4e5708b6a4396939dbdc6e65fd0f4cd162a61 (diff)
downloadbusybox-w32-deb80875c85869db51883249f66ca92edca00bb9.tar.gz
busybox-w32-deb80875c85869db51883249f66ca92edca00bb9.tar.bz2
busybox-w32-deb80875c85869db51883249f66ca92edca00bb9.zip
Another hush update from Larry:
Fixes the interaction between if/then/else/fi syntax and variables. I planned to do it right from the beginning, but my implementation was buggy. Also adds the relevant test cases. Also adds some old Matt Kraai variable test cases that got left out somehow. git-svn-id: svn://busybox.net/trunk/busybox@2804 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'tests')
-rw-r--r--tests/sh.testcases29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/sh.testcases b/tests/sh.testcases
index 88e709f87..e2a75873e 100644
--- a/tests/sh.testcases
+++ b/tests/sh.testcases
@@ -28,6 +28,35 @@ if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo
28if true || false; then echo foo; else echo bar5; fi 28if true || false; then echo foo; else echo bar5; fi
29if true && false; then echo bar6; else echo foo; fi 29if true && false; then echo bar6; else echo foo; fi
30 30
31# basic distinction between local and env variables
32unset FOO
33FOO=bar env | grep FOO
34echo "but not here: $FOO"
35FOO=bar
36env | grep FOO
37echo "yes, here: $FOO"
38FOO=
39echo a $FOO b
40echo "a $FOO b"
41
42# not quite so basic variables. Credit to Matt Kraai.
43unset FOO
44FOO=bar
45export FOO
46env | grep FOO
47unset FOO
48export FOO=bar
49FOO=baz
50env | grep FOO
51
52# interaction between environment variables and if/then and subshells
53FOO=default
54if true; then FOO=new; fi
55echo $FOO
56FOO=default
57(FOO=bogus)
58echo $FOO
59
31# make sure we can duplicate file descriptors properly 60# make sure we can duplicate file descriptors properly
32echo replacement >foo 2>&1 61echo replacement >foo 2>&1
33cat foo 62cat foo