diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-22 17:58:14 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-22 17:58:14 +0100 |
commit | 7b4c0fd5f4df4541a1659de04823326cd22c254e (patch) | |
tree | b0e14ceeb84af1155ba5dd25016569b20ff1e700 /shell/hush_test | |
parent | 1e23f32453d8aa84c66c8f0bb9f753d68614d05a (diff) | |
download | busybox-w32-7b4c0fd5f4df4541a1659de04823326cd22c254e.tar.gz busybox-w32-7b4c0fd5f4df4541a1659de04823326cd22c254e.tar.bz2 busybox-w32-7b4c0fd5f4df4541a1659de04823326cd22c254e.zip |
hush: fix improper handling of newline and hash chars in few corner cases
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-misc/assignment3.right | 2 | ||||
-rwxr-xr-x | shell/hush_test/hush-misc/assignment3.tests | 5 | ||||
-rw-r--r-- | shell/hush_test/hush-parsing/comment1.right | 2 | ||||
-rwxr-xr-x | shell/hush_test/hush-parsing/comment1.tests | 2 | ||||
-rw-r--r-- | shell/hush_test/hush-parsing/eol1.right | 1 | ||||
-rwxr-xr-x | shell/hush_test/hush-parsing/eol1.tests | 18 |
6 files changed, 30 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/assignment3.right b/shell/hush_test/hush-misc/assignment3.right new file mode 100644 index 000000000..0f02d7cbc --- /dev/null +++ b/shell/hush_test/hush-misc/assignment3.right | |||
@@ -0,0 +1,2 @@ | |||
1 | Done:0 | ||
2 | abc=123 | ||
diff --git a/shell/hush_test/hush-misc/assignment3.tests b/shell/hush_test/hush-misc/assignment3.tests new file mode 100755 index 000000000..790129be1 --- /dev/null +++ b/shell/hush_test/hush-misc/assignment3.tests | |||
@@ -0,0 +1,5 @@ | |||
1 | # This must be interpreted as assignments | ||
2 | a=1 b\ | ||
3 | =2 c=3 | ||
4 | echo Done:$? | ||
5 | echo abc=$a$b$c | ||
diff --git a/shell/hush_test/hush-parsing/comment1.right b/shell/hush_test/hush-parsing/comment1.right new file mode 100644 index 000000000..a102b1d4e --- /dev/null +++ b/shell/hush_test/hush-parsing/comment1.right | |||
@@ -0,0 +1,2 @@ | |||
1 | Nothing: | ||
2 | String: #should-be-echoed | ||
diff --git a/shell/hush_test/hush-parsing/comment1.tests b/shell/hush_test/hush-parsing/comment1.tests new file mode 100755 index 000000000..d268860ff --- /dev/null +++ b/shell/hush_test/hush-parsing/comment1.tests | |||
@@ -0,0 +1,2 @@ | |||
1 | echo Nothing: #should-not-be-echoed | ||
2 | echo String: ""#should-be-echoed | ||
diff --git a/shell/hush_test/hush-parsing/eol1.right b/shell/hush_test/hush-parsing/eol1.right new file mode 100644 index 000000000..31c896f62 --- /dev/null +++ b/shell/hush_test/hush-parsing/eol1.right | |||
@@ -0,0 +1 @@ | |||
Done:0 | |||
diff --git a/shell/hush_test/hush-parsing/eol1.tests b/shell/hush_test/hush-parsing/eol1.tests new file mode 100755 index 000000000..f1b55e8b8 --- /dev/null +++ b/shell/hush_test/hush-parsing/eol1.tests | |||
@@ -0,0 +1,18 @@ | |||
1 | # bug was that we treated <newline> as ';' in this line: | ||
2 | true || echo foo | | ||
3 | echo BAD1 | cat | ||
4 | |||
5 | # variation on the same theme | ||
6 | true || echo foo | | ||
7 | # comment | ||
8 | echo BAD2 | cat | ||
9 | |||
10 | # variation on the same theme | ||
11 | true || echo foo | | ||
12 | |||
13 | echo BAD3 | cat | ||
14 | |||
15 | # this should error out, but currently works in hush: | ||
16 | #true || echo foo |; | ||
17 | |||
18 | echo Done:$? | ||