From dd316dd283704b9adb588c3fb7cdec6ba5fbceb8 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 14 Jun 2008 15:50:55 +0000 Subject: hush: add support for ':'; create testsuite entries text data bss dec hex filename 809569 612 7044 817225 c7849 busybox_old 809528 612 7044 817184 c7820 busybox_unstripped --- shell/hush_test/hush-bugs/glob_and_assign.right | 2 ++ shell/hush_test/hush-bugs/glob_and_assign.tests | 18 ++++++++++++++++++ shell/hush_test/hush-bugs/glob_and_vars.right | 1 + shell/hush_test/hush-bugs/glob_and_vars.tests | 2 ++ shell/hush_test/hush-bugs/while_in_subshell.right | 1 + shell/hush_test/hush-bugs/while_in_subshell.tests | 2 ++ shell/hush_test/hush-misc/colon.right | 2 ++ shell/hush_test/hush-misc/colon.tests | 6 ++++++ shell/hush_test/zbad | 3 --- shell/hush_test/zbad2 | 19 ------------------- 10 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 shell/hush_test/hush-bugs/glob_and_assign.right create mode 100755 shell/hush_test/hush-bugs/glob_and_assign.tests create mode 100644 shell/hush_test/hush-bugs/glob_and_vars.right create mode 100755 shell/hush_test/hush-bugs/glob_and_vars.tests create mode 100644 shell/hush_test/hush-bugs/while_in_subshell.right create mode 100755 shell/hush_test/hush-bugs/while_in_subshell.tests create mode 100644 shell/hush_test/hush-misc/colon.right create mode 100755 shell/hush_test/hush-misc/colon.tests delete mode 100644 shell/hush_test/zbad delete mode 100644 shell/hush_test/zbad2 (limited to 'shell/hush_test') diff --git a/shell/hush_test/hush-bugs/glob_and_assign.right b/shell/hush_test/hush-bugs/glob_and_assign.right new file mode 100644 index 0000000..dae8323 --- /dev/null +++ b/shell/hush_test/hush-bugs/glob_and_assign.right @@ -0,0 +1,2 @@ +ZVAR=z.map +*.map diff --git a/shell/hush_test/hush-bugs/glob_and_assign.tests b/shell/hush_test/hush-bugs/glob_and_assign.tests new file mode 100755 index 0000000..ea11e36 --- /dev/null +++ b/shell/hush_test/hush-bugs/glob_and_assign.tests @@ -0,0 +1,18 @@ +## # bash zbad2 +## ZVAR=z.map +## *.map +## # hush zbad2 +## ZVAR=z.map +## z.map <====== !!! + +## hush does globbing for "VAR=val" too! +## it should do it only for non-assignments. +## even if word looks like assignment, it can be non-assignment: +## ZVAR=*.map /bin/echo ZVAR=*.map +## ^dont_glob ^glob + +>ZVAR=z.map +ZVAR=*.map /bin/echo ZVAR=*.map +ZVAR=*.map +echo "$ZVAR" +rm ZVAR=z.map diff --git a/shell/hush_test/hush-bugs/glob_and_vars.right b/shell/hush_test/hush-bugs/glob_and_vars.right new file mode 100644 index 0000000..3ac7ec5 --- /dev/null +++ b/shell/hush_test/hush-bugs/glob_and_vars.right @@ -0,0 +1 @@ +./glob_and_vars.right ./glob_and_vars.tests diff --git a/shell/hush_test/hush-bugs/glob_and_vars.tests b/shell/hush_test/hush-bugs/glob_and_vars.tests new file mode 100755 index 0000000..c8e0c06 --- /dev/null +++ b/shell/hush_test/hush-bugs/glob_and_vars.tests @@ -0,0 +1,2 @@ +v=. +echo $v/glob_and_vars.* diff --git a/shell/hush_test/hush-bugs/while_in_subshell.right b/shell/hush_test/hush-bugs/while_in_subshell.right new file mode 100644 index 0000000..290d39b --- /dev/null +++ b/shell/hush_test/hush-bugs/while_in_subshell.right @@ -0,0 +1 @@ +OK: 0 diff --git a/shell/hush_test/hush-bugs/while_in_subshell.tests b/shell/hush_test/hush-bugs/while_in_subshell.tests new file mode 100755 index 0000000..def8e09 --- /dev/null +++ b/shell/hush_test/hush-bugs/while_in_subshell.tests @@ -0,0 +1,2 @@ +(while true; do exit; done) +echo OK: $? diff --git a/shell/hush_test/hush-misc/colon.right b/shell/hush_test/hush-misc/colon.right new file mode 100644 index 0000000..2a87d02 --- /dev/null +++ b/shell/hush_test/hush-misc/colon.right @@ -0,0 +1,2 @@ +0 +OK: 0 diff --git a/shell/hush_test/hush-misc/colon.tests b/shell/hush_test/hush-misc/colon.tests new file mode 100755 index 0000000..ea3b4d5 --- /dev/null +++ b/shell/hush_test/hush-misc/colon.tests @@ -0,0 +1,6 @@ +false +: +echo $? +# Extra ; after done is due to a bug +(while :; do exit; done;) +echo OK: $? diff --git a/shell/hush_test/zbad b/shell/hush_test/zbad deleted file mode 100644 index e4b5caa..0000000 --- a/shell/hush_test/zbad +++ /dev/null @@ -1,3 +0,0 @@ -# TODO: hush doesn't know ':' null command - -while :; do exit; done diff --git a/shell/hush_test/zbad2 b/shell/hush_test/zbad2 deleted file mode 100644 index b6fffe5..0000000 --- a/shell/hush_test/zbad2 +++ /dev/null @@ -1,19 +0,0 @@ -## TODO: fix and add to testsuite - -## # bash zbad2 -## ZVAR=z.map -## *.map -## # hush zbad2 -## ZVAR=z.map -## z.map <====== !!! - -## hush does globbing for "VAR=val" too! -## it should do it only for non-assignments. -## even if word looks like assignment, it can be non-assignment: -## ZVAR=*.map /bin/echo ZVAR=*.map -## ^dont_glob ^glob - ->ZVAR=z.map -ZVAR=*.map /bin/echo ZVAR=*.map -ZVAR=*.map -echo "$ZVAR" -- cgit v1.1