diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-16 10:59:40 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-16 10:59:40 +0000 |
commit | bb929517a86092481ed8547e9f247c1b58bc4745 (patch) | |
tree | 61113710afec0eb112df4b6854c5ec6d2f9662a3 /shell/hush_test/hush-parsing | |
parent | 74a931ac9ea807d14a44baf3fdb957bc58db14c6 (diff) | |
download | busybox-w32-bb929517a86092481ed8547e9f247c1b58bc4745.tar.gz busybox-w32-bb929517a86092481ed8547e9f247c1b58bc4745.tar.bz2 busybox-w32-bb929517a86092481ed8547e9f247c1b58bc4745.zip |
hush: fix "if { echo foo; } then { echo bar; } fi" parsing
function old new delta
done_word 728 793 +65
parse_stream 2084 2098 +14
Diffstat (limited to 'shell/hush_test/hush-parsing')
-rw-r--r-- | shell/hush_test/hush-parsing/groups_and_keywords1.right | 11 | ||||
-rwxr-xr-x | shell/hush_test/hush-parsing/groups_and_keywords1.tests | 10 |
2 files changed, 21 insertions, 0 deletions
diff --git a/shell/hush_test/hush-parsing/groups_and_keywords1.right b/shell/hush_test/hush-parsing/groups_and_keywords1.right new file mode 100644 index 000000000..4c46650dc --- /dev/null +++ b/shell/hush_test/hush-parsing/groups_and_keywords1.right | |||
@@ -0,0 +1,11 @@ | |||
1 | Semicolons after } can be omitted 1: | ||
2 | foo | ||
3 | bar | ||
4 | Semicolons after } can be omitted 2: | ||
5 | foo | ||
6 | bar | ||
7 | Semicolons after fi can be omitted: | ||
8 | foo | ||
9 | bar | ||
10 | baz | ||
11 | Done:0 | ||
diff --git a/shell/hush_test/hush-parsing/groups_and_keywords1.tests b/shell/hush_test/hush-parsing/groups_and_keywords1.tests new file mode 100755 index 000000000..01944d714 --- /dev/null +++ b/shell/hush_test/hush-parsing/groups_and_keywords1.tests | |||
@@ -0,0 +1,10 @@ | |||
1 | echo "Semicolons after } can be omitted 1:" | ||
2 | if { echo foo; } then { echo bar; } fi | ||
3 | |||
4 | echo "Semicolons after } can be omitted 2:" | ||
5 | while { echo foo; } do { echo bar; break; } done | ||
6 | |||
7 | echo "Semicolons after fi can be omitted:" | ||
8 | while if echo foo; then echo bar; fi do echo baz; break; done | ||
9 | |||
10 | echo Done:$? | ||