aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-01-08 22:42:35 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2022-01-08 22:42:35 +0100
commite2952dfaff67f3641d3a6d3226753356170ff808 (patch)
tree6d77f7f379ba14fbc86bc8ef362fccefa8039f70 /testsuite
parent84a1305888ffcd0f4e47cfc4c6fc57918b97bdda (diff)
downloadbusybox-w32-e2952dfaff67f3641d3a6d3226753356170ff808.tar.gz
busybox-w32-e2952dfaff67f3641d3a6d3226753356170ff808.tar.bz2
busybox-w32-e2952dfaff67f3641d3a6d3226753356170ff808.zip
awk: input numbers are never octal or hex (only program consts can be)
function old new delta next_token 825 930 +105 getvar_i 114 129 +15 nextchar 49 53 +4 my_strtod 138 - -138 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 3/0 up/down: 124/-138) Total: -14 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/awk.tests12
1 files changed, 11 insertions, 1 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index bcaafe8fd..93e25d8c1 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -102,9 +102,13 @@ testing "awk unused function args are evaluated" \
102optional DESKTOP 102optional DESKTOP
103testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n" 103testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n"
104testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2147483649\n" "" "\n" 104testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2147483649\n" "" "\n"
105testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n" 105testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n"
106SKIP= 106SKIP=
107 107
108# check that "hex/oct integer" heuristic doesn't kick in on input
109# (must be done only when parsing program text)
110testing "awk input is never oct" "awk '{ print \$1, \$1+1 }'" "011 12\n" "" "011\n"
111
108# check that "hex/oct integer" heuristic doesn't kick in on 00NN.NNN 112# check that "hex/oct integer" heuristic doesn't kick in on 00NN.NNN
109testing "awk floating const with leading zeroes" \ 113testing "awk floating const with leading zeroes" \
110 "awk '{ printf \"%f %f\n\", \"000.123\", \"009.123\" }'" \ 114 "awk '{ printf \"%f %f\n\", \"000.123\", \"009.123\" }'" \
@@ -469,4 +473,10 @@ testing 'awk printf %% prints one %' \
469 "%\n" \ 473 "%\n" \
470 '' '' 474 '' ''
471 475
476testing 'awk backslash+newline eaten with no trace' \
477 "awk 'BEGIN { printf \"Hello\\
478 world\n\" }'" \
479 "Hello world\n" \
480 '' ''
481
472exit $FAILCOUNT 482exit $FAILCOUNT