summaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenis Vlasenko2007-05-13 18:34:53 +0000
committerDenis Vlasenko2007-05-13 18:34:53 +0000
commit602d13cba552fadb8481283aa7872a4b9f206c48 (patch)
tree224cc9027daa059db593e561526a8bb13f95de25 /shell/hush_test
parent119b995437c52a164b2c5e51ef918c3f46b8a130 (diff)
downloadbusybox-602d13cba552fadb8481283aa7872a4b9f206c48.zip
busybox-602d13cba552fadb8481283aa7872a4b9f206c48.tar.gz
hush: fix '{ false; echo $?; }' bug.
hush: expand testsuite. variable expansion is still very broken
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-bugs/argv0.right1
-rwxr-xr-xshell/hush_test/hush-bugs/argv0.tests4
-rw-r--r--shell/hush_test/hush-bugs/quote1.right1
-rwxr-xr-xshell/hush_test/hush-bugs/quote1.tests2
-rw-r--r--shell/hush_test/hush-bugs/quote2.right1
-rwxr-xr-xshell/hush_test/hush-bugs/quote2.tests2
-rw-r--r--shell/hush_test/hush-bugs/starquoted.right1
-rwxr-xr-xshell/hush_test/hush-bugs/starquoted.tests4
-rw-r--r--shell/hush_test/hush-vars/star.right5
-rwxr-xr-xshell/hush_test/hush-vars/star.tests8
-rw-r--r--shell/hush_test/hush-vars/var.right2
-rwxr-xr-xshell/hush_test/hush-vars/var.tests1
12 files changed, 30 insertions, 2 deletions
diff --git a/shell/hush_test/hush-bugs/argv0.right b/shell/hush_test/hush-bugs/argv0.right
new file mode 100644
index 0000000..d86bac9
--- /dev/null
+++ b/shell/hush_test/hush-bugs/argv0.right
@@ -0,0 +1 @@
+OK
diff --git a/shell/hush_test/hush-bugs/argv0.tests b/shell/hush_test/hush-bugs/argv0.tests
new file mode 100755
index 0000000..f5c40f6
--- /dev/null
+++ b/shell/hush_test/hush-bugs/argv0.tests
@@ -0,0 +1,4 @@
+if test $# = 0; then
+ exec "$THIS_SH" "$0" arg
+fi
+echo OK
diff --git a/shell/hush_test/hush-bugs/quote1.right b/shell/hush_test/hush-bugs/quote1.right
new file mode 100644
index 0000000..cb38205
--- /dev/null
+++ b/shell/hush_test/hush-bugs/quote1.right
@@ -0,0 +1 @@
+'1'
diff --git a/shell/hush_test/hush-bugs/quote1.tests b/shell/hush_test/hush-bugs/quote1.tests
new file mode 100755
index 0000000..f558954
--- /dev/null
+++ b/shell/hush_test/hush-bugs/quote1.tests
@@ -0,0 +1,2 @@
+a=1
+echo "'$a'"
diff --git a/shell/hush_test/hush-bugs/quote2.right b/shell/hush_test/hush-bugs/quote2.right
new file mode 100644
index 0000000..3bc9edc
--- /dev/null
+++ b/shell/hush_test/hush-bugs/quote2.right
@@ -0,0 +1 @@
+>1
diff --git a/shell/hush_test/hush-bugs/quote2.tests b/shell/hush_test/hush-bugs/quote2.tests
new file mode 100755
index 0000000..bd966f3
--- /dev/null
+++ b/shell/hush_test/hush-bugs/quote2.tests
@@ -0,0 +1,2 @@
+a=1
+echo ">$a"
diff --git a/shell/hush_test/hush-bugs/starquoted.right b/shell/hush_test/hush-bugs/starquoted.right
new file mode 100644
index 0000000..fedaf48
--- /dev/null
+++ b/shell/hush_test/hush-bugs/starquoted.right
@@ -0,0 +1 @@
+.1 abc d e f.
diff --git a/shell/hush_test/hush-bugs/starquoted.tests b/shell/hush_test/hush-bugs/starquoted.tests
new file mode 100755
index 0000000..3be2026
--- /dev/null
+++ b/shell/hush_test/hush-bugs/starquoted.tests
@@ -0,0 +1,4 @@
+if test $# = 0; then
+ exec "$THIS_SH" starquoted.tests 1 abc 'd e f'
+fi
+for a in "$*"; do echo ".$a."; done
diff --git a/shell/hush_test/hush-vars/star.right b/shell/hush_test/hush-vars/star.right
new file mode 100644
index 0000000..b33b176
--- /dev/null
+++ b/shell/hush_test/hush-vars/star.right
@@ -0,0 +1,5 @@
+.1.
+.abc.
+.d.
+.e.
+.f.
diff --git a/shell/hush_test/hush-vars/star.tests b/shell/hush_test/hush-vars/star.tests
new file mode 100755
index 0000000..1914dde
--- /dev/null
+++ b/shell/hush_test/hush-vars/star.tests
@@ -0,0 +1,8 @@
+if test $# = 0; then
+ exec "$THIS_SH" star.tests 1 abc 'd e f'
+fi
+# 'd e f' should be split into 3 separate args:
+for a in $*; do echo ".$a."; done
+
+# must produce .1 abc d e f. Currently does not
+#for a in "$*"; do echo ".$a."; done
diff --git a/shell/hush_test/hush-vars/var.right b/shell/hush_test/hush-vars/var.right
index c13b98e..14b2314 100644
--- a/shell/hush_test/hush-vars/var.right
+++ b/shell/hush_test/hush-vars/var.right
@@ -1,4 +1,4 @@
http://busybox.net
http://busybox.net_abc
1
-0
+1
diff --git a/shell/hush_test/hush-vars/var.tests b/shell/hush_test/hush-vars/var.tests
index b0637ea..0a63696 100755
--- a/shell/hush_test/hush-vars/var.tests
+++ b/shell/hush_test/hush-vars/var.tests
@@ -6,5 +6,4 @@ echo ${URL}_abc
true
false; echo $?
true
-# BUG: prints 0, must be 1
{ false; echo $?; }