summaryrefslogtreecommitdiff
path: root/testsuite/bc.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2019-01-04 13:58:46 +0100
committerDenys Vlasenko2019-01-04 13:58:46 +0100
commit54f5c1d6006ffbf03455a180ba6b7cbd5352b7f5 (patch)
treea779671638b391ef5e04603f3efbbc24033ae36d /testsuite/bc.tests
parent1db367a8e65a74277360a89885ff7d377b5feb8b (diff)
downloadbusybox-54f5c1d6006ffbf03455a180ba6b7cbd5352b7f5.zip
busybox-54f5c1d6006ffbf03455a180ba6b7cbd5352b7f5.tar.gz
bc: support void functions (GNU compat)
function old new delta xc_program_print - 689 +689 zxc_vm_process 814 869 +55 zxc_program_exec 4098 4116 +18 zxc_program_assign 385 392 +7 bc_result_free 43 46 +3 zxc_program_binOpPrep 243 245 +2 zdc_program_execStr 518 520 +2 zxc_program_print 683 - -683 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 6/0 up/down: 776/-683) Total: 93 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/bc.tests')
-rwxr-xr-xtestsuite/bc.tests17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/bc.tests b/testsuite/bc.tests
index 0a8222b..3fde60a 100755
--- a/testsuite/bc.tests
+++ b/testsuite/bc.tests
@@ -123,6 +123,23 @@ testing "bc define with body on next line" \
"8\n9\n" \
"" "define w()\n{ auto z; return 8; }\nw()\n9"
+testing "bc void function" \
+ "bc" \
+ "void9\n" \
+ "" "define void w() {print \"void\"}\nw()\n9"
+
+# Extra POSIX compat - GNU bc does not allow this
+testing "bc function named 'void'" \
+ "bc" \
+ "void0\n9\n" \
+ "" "define void() {print \"void\"}\nvoid()\n9"
+
+# Extra POSIX compat - GNU bc does not allow this
+testing "bc variable named 'void'" \
+ "bc" \
+ "6\n9\n" \
+ "" "void=6\nvoid\n9"
+
testing "bc if(cond)<NL>" \
"bc" \
"9\n" \