aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-25 23:45:57 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-25 23:45:57 +0100
commit94576d2b972b3bd136fbe8057c95690ae36ea8c9 (patch)
treecc1b99c8e3fb95448b7595fea6b141516894cf40 /testsuite
parentc192b0442b0b3f50d4fbb34322e07f0ff3c5aecd (diff)
downloadbusybox-w32-94576d2b972b3bd136fbe8057c95690ae36ea8c9.tar.gz
busybox-w32-94576d2b972b3bd136fbe8057c95690ae36ea8c9.tar.bz2
busybox-w32-94576d2b972b3bd136fbe8057c95690ae36ea8c9.zip
bc: fix interactive handling of comments in strings and quotes in comments
function old new delta zbc_lex_next 1965 1979 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/bc.tests16
1 files changed, 14 insertions, 2 deletions
diff --git a/testsuite/bc.tests b/testsuite/bc.tests
index 42fe83013..3fbb49996 100755
--- a/testsuite/bc.tests
+++ b/testsuite/bc.tests
@@ -6,16 +6,28 @@
6 6
7# testing "test name" "command" "expected result" "file input" "stdin" 7# testing "test name" "command" "expected result" "file input" "stdin"
8 8
9testing "bc comment 1" \ 9testing "bc comment" \
10 "bc" \ 10 "bc" \
11 "3\n" \ 11 "3\n" \
12 "" "1 /* comment */ + 2" 12 "" "1 /* comment */ + 2"
13 13
14testing "bc comment 2: /*/ is not a closed comment" \ 14testing "bc /*/ is not a closed comment" \
15 "bc" \ 15 "bc" \
16 "4\n" \ 16 "4\n" \
17 "" "1 /*/ + 2 */ + 3" 17 "" "1 /*/ + 2 */ + 3"
18 18
19# this needs interactive testing
20testing "bc comment with \"" \
21 "bc" \
22 "3\n" \
23 "" "1 /* \" */ + 2"
24
25# this needs interactive testing
26testing "bc \"string/*\" is not a comment" \
27 "bc" \
28 "string/*9\n" \
29 "" "\"string/*\";9"
30
19testing "bc comment 3: unterminated #comment" \ 31testing "bc comment 3: unterminated #comment" \
20 "bc" \ 32 "bc" \
21 "" \ 33 "" \