aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-misc/assignment1.tests
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-08-04 00:46:07 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-08-04 00:46:07 +0000
commit2b576b8e76ee0dc548f46489e2546b7ed70d080d (patch)
treea04f9fb858ba1180f04319e656a0b43623655bca /shell/hush_test/hush-misc/assignment1.tests
parentc8bec9a0852ce6ce09a67d8a688623e32735378e (diff)
downloadbusybox-2b576b8e76ee0dc548f46489e2546b7ed70d080d.tar.gz
hush: fix mishandling of a'b'c=fff as assignments. They are not.
function old new delta parse_stream 1920 2004 +84 done_word 715 752 +37 parse_and_run_stream 328 333 +5 builtin_exec 25 29 +4 pseudo_exec_argv 138 139 +1 run_list 2006 1999 -7 is_assignment 215 134 -81 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/2 up/down: 131/-88) Total: 43 bytes
Diffstat (limited to 'shell/hush_test/hush-misc/assignment1.tests')
-rwxr-xr-xshell/hush_test/hush-misc/assignment1.tests42
1 files changed, 42 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/assignment1.tests b/shell/hush_test/hush-misc/assignment1.tests
new file mode 100755
index 000000000..033b35250
--- /dev/null
+++ b/shell/hush_test/hush-misc/assignment1.tests
@@ -0,0 +1,42 @@
+# Assignments after some keywords should still work
+
+if a=1 true; then a=1 true; elif a=1 true; then a=1 true; else a=1 true; fi
+echo if1:$?
+while a=1 true; do a=1 true; break; done
+echo while1:$?
+until a=1 false; do a=1 true; break; done
+echo until1:$?
+
+if a=1 true
+ then a=1 true
+ elif a=1 true
+ then a=1 true
+ else a=1 true
+ fi
+echo if2:$?
+while a=1 true
+ do a=1 true
+ break
+ done
+echo while2:$?
+until a=1 false
+ do a=1 true
+ break
+ done
+echo until2:$?
+
+if
+ a=1 true; then
+ a=1 true; elif
+ a=1 true; then
+ a=1 true; else
+ a=1 true; fi
+echo if3:$?
+while
+ a=1 true; do
+ a=1 true; break; done
+echo while3:$?
+until
+ a=1 false; do
+ a=1 true; break; done
+echo until3:$?