aboutsummaryrefslogtreecommitdiff
path: root/testsuite/bc.tests
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-01-01 21:50:14 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2019-02-14 14:40:57 +0100
commitf23c04af2d4575836cb5d9d1ea9176310ed633b5 (patch)
treeafc70c197e9b5ef3056fb83eff31e8dab03d04a0 /testsuite/bc.tests
parentc3de036da92777d69ea0a9725130085d546c366a (diff)
downloadbusybox-w32-f23c04af2d4575836cb5d9d1ea9176310ed633b5.tar.gz
busybox-w32-f23c04af2d4575836cb5d9d1ea9176310ed633b5.tar.bz2
busybox-w32-f23c04af2d4575836cb5d9d1ea9176310ed633b5.zip
bc: upstream fixes
function old new delta bc_parse_expr_empty_ok 1764 1843 +79 bc_error_at - 62 +62 bc_parse_inst_isLeaf - 30 +30 zbc_func_insert 100 120 +20 bc_error_bad_function_definition - 10 +10 bc_error_bad_assignment - 10 +10 zxc_lex_next 1608 1614 +6 ok_in_expr 30 - -30 zxc_vm_process 874 839 -35 ------------------------------------------------------------------------------ (add/remove: 4/1 grow/shrink: 3/1 up/down: 217/-65) Total: 152 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rwxr-xr-xtestsuite/bc.tests16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/bc.tests b/testsuite/bc.tests
index 1d4545559..13525ea52 100755
--- a/testsuite/bc.tests
+++ b/testsuite/bc.tests
@@ -108,6 +108,11 @@ testing "bc define auto" \
108 "8\n9\n" \ 108 "8\n9\n" \
109 "" "define w() { auto z; return 8; }; w(); 9" 109 "" "define w() { auto z; return 8; }; w(); 9"
110 110
111testing "bc define auto array same name" \
112 "bc" \
113 "8\n9\n" \
114 "" "define w(x) { auto x[]; return x; }; w(8); 9"
115
111testing "bc define with body on next line" \ 116testing "bc define with body on next line" \
112 "bc" \ 117 "bc" \
113 "8\n9\n" \ 118 "8\n9\n" \
@@ -133,6 +138,17 @@ testing "bc ifz does not match if keyword" \
133 "1\n2\n2\n3\n" \ 138 "1\n2\n2\n3\n" \
134 "" "ifz=1;ifz\n++ifz;ifz++\nifz" 139 "" "ifz=1;ifz\n++ifz;ifz++\nifz"
135 140
141# had parse error on "f()-N"
142testing "bc -l 'e(0)-2'" \
143 "bc -l" \
144 "-1.00000000000000000000\n" \
145 "" "e(0)-2"
146
147testing "bc (!a&&b)" \
148 "bc" \
149 "0\n" \
150 "" "(!a&&b)"
151
136testing "bc print 1,2,3" \ 152testing "bc print 1,2,3" \
137 "bc" \ 153 "bc" \
138 "123" \ 154 "123" \