aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-22 01:34:10 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-22 01:34:10 +0100
commit8c1e72359626789b1b98aeac0225d73d1336bb59 (patch)
tree7c89877da4953bccddb88943e49def923c2d7a40 /testsuite
parent1dc4de9d9bbdf3f60b76cecf94d756ef9394e25f (diff)
downloadbusybox-8c1e72359626789b1b98aeac0225d73d1336bb59.tar.gz
bc: unbreak read(), remove checks for nested read()
function old new delta zbc_parse_pushSTR - 65 +65 common_parse_expr - 32 +32 bc_error_nested_read_call 10 - -10 bc_parse_expr_empty_ok 1977 1963 -14 zdc_parse_expr 635 615 -20 zcommon_parse_expr 32 - -32 zbc_program_exec 4064 4023 -41 bc_parse_pushSTR 65 - -65 ------------------------------------------------------------------------------ (add/remove: 2/3 grow/shrink: 0/3 up/down: 97/-182) Total: -85 bytes text data bss dec hex filename 981661 485 7296 989442 f1902 busybox_old 981540 485 7296 989321 f1889 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/bc.tests15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/bc.tests b/testsuite/bc.tests
index b3ce894ee..c84a2987c 100755
--- a/testsuite/bc.tests
+++ b/testsuite/bc.tests
@@ -31,6 +31,21 @@ testing "bc string 1" \
"STR\n" \
"" "\"STR\n\""
+testing "bc read() 4<EOF>" \
+ "bc input" \
+ "4\n" \
+ "read();halt" "4"
+
+testing "bc read()^2" \
+ "bc input" \
+ "16\n" \
+ "read()^2;halt" "4\n"
+
+testing "bc read()*read()" \
+ "bc input" \
+ "20\n" \
+ "read()*read();halt" "4\n5"
+
testing "bc if 0 else" \
"bc" \
"2\n9\n" \