aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-misc
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-10 12:03:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-10 12:03:20 +0000
commit1fd1ea4395e520694bd9f8b1dc9e60af6442946d (patch)
treeffe931a1e9254789ac119321f88b17767176c73c /shell/hush_test/hush-misc
parent551bdfecb7cfb4df0f127d34884e0a9502324acd (diff)
downloadbusybox-w32-1fd1ea4395e520694bd9f8b1dc9e60af6442946d.tar.gz
busybox-w32-1fd1ea4395e520694bd9f8b1dc9e60af6442946d.tar.bz2
busybox-w32-1fd1ea4395e520694bd9f8b1dc9e60af6442946d.zip
hush: tighten up "for" variable name check.
Add TODOs. Disable redir4.right part where we differ from bash. It is not a bug per standards. Add a few tests, one is in hush-bugs section: and_or_and_backgrounding.right. It will likely bite users in real world usage.
Diffstat (limited to 'shell/hush_test/hush-misc')
-rw-r--r--shell/hush_test/hush-misc/for_with_bslashes.right8
-rwxr-xr-xshell/hush_test/hush-misc/for_with_bslashes.tests10
-rwxr-xr-xshell/hush_test/hush-misc/redir1.tests2
-rw-r--r--shell/hush_test/hush-misc/redir4.right11
-rwxr-xr-xshell/hush_test/hush-misc/redir4.tests7
5 files changed, 27 insertions, 11 deletions
diff --git a/shell/hush_test/hush-misc/for_with_bslashes.right b/shell/hush_test/hush-misc/for_with_bslashes.right
new file mode 100644
index 000000000..02d96692c
--- /dev/null
+++ b/shell/hush_test/hush-misc/for_with_bslashes.right
@@ -0,0 +1,8 @@
1a
2b\c
3b\\c
4b"c
5b'c
6b$c
7b`true`c
8Zero:0
diff --git a/shell/hush_test/hush-misc/for_with_bslashes.tests b/shell/hush_test/hush-misc/for_with_bslashes.tests
new file mode 100755
index 000000000..363f3d85b
--- /dev/null
+++ b/shell/hush_test/hush-misc/for_with_bslashes.tests
@@ -0,0 +1,10 @@
1# UNFIXED BUG.
2# commented-out words contain ^C character.
3# It's a SPECIAL_VAR_SYMBOL, for now hush does not escape it.
4# When it is fixed, update this test.
5
6for a in 'a' 'b\c' 'b\\c' 'b"c' "b'c" 'b$c' 'b`true`c' ### 'b#c'
7do
8 echo $a
9done
10echo Zero:$?
diff --git a/shell/hush_test/hush-misc/redir1.tests b/shell/hush_test/hush-misc/redir1.tests
index 70e9e17f0..ef2fbfb77 100755
--- a/shell/hush_test/hush-misc/redir1.tests
+++ b/shell/hush_test/hush-misc/redir1.tests
@@ -27,7 +27,7 @@ var=ok
27{ var=bad >shell_test_$$; } & 27{ var=bad >shell_test_$$; } &
28# cant use usleep as it isnt standard in $PATH -- 28# cant use usleep as it isnt standard in $PATH --
29# we fail when testing busybox compiled solely as "hush" 29# we fail when testing busybox compiled solely as "hush"
30sleep 1 30wait
31echo "Test 4: var:$var" 31echo "Test 4: var:$var"
32test -f shell_test_$$ && echo "File created:ok" 32test -f shell_test_$$ && echo "File created:ok"
33 33
diff --git a/shell/hush_test/hush-misc/redir4.right b/shell/hush_test/hush-misc/redir4.right
index ada6c2d85..ead25f603 100644
--- a/shell/hush_test/hush-misc/redir4.right
+++ b/shell/hush_test/hush-misc/redir4.right
@@ -10,16 +10,9 @@ Here3
10Ok3 10Ok3
11Here4 11Here4
12Ok4 12Ok4
13How with variable refs 13Now with variable refs
14shell_test_1 14shell_test_1
15\shell_test_1 15\shell_test_1
16\shell_test_1 16\shell_test_1
17\shell_test_1 17\shell_test_1
18Here1 18Done
19Ok1
20Here2
21Ok2
22Here3
23Ok3
24Here4
25Ok4
diff --git a/shell/hush_test/hush-misc/redir4.tests b/shell/hush_test/hush-misc/redir4.tests
index ac2a44166..c50b8cedf 100755
--- a/shell/hush_test/hush-misc/redir4.tests
+++ b/shell/hush_test/hush-misc/redir4.tests
@@ -38,7 +38,7 @@ Here4
38echo Ok4 38echo Ok4
39 39
40 40
41echo How with variable refs 41echo Now with variable refs
42i=1 42i=1
43 43
44 44
@@ -58,6 +58,11 @@ rm *shell_test*
58echo *shell_test* 58echo *shell_test*
59rm *shell_test* 59rm *shell_test*
60 60
61echo Done;exit
62# UNFIXED BUG. bash apparently will expand $i even in terminating delimiter.
63# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
64# does not mandate this behavior.
65# This is not likely to be used much in real-world.
61 66
62cat <<\shell_test_$i 67cat <<\shell_test_$i
63Here1 68Here1