diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-30 12:52:51 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-30 12:52:51 +0200 |
commit | d7354df169603807fe2ac4f8a0f9f72c9703184f (patch) | |
tree | f93f4b2564b617420d4c4b3b7032b0e557e999ea /testsuite | |
parent | ca9278ee5855a91a5521960d3743809f47ed27b8 (diff) | |
download | busybox-w32-d7354df169603807fe2ac4f8a0f9f72c9703184f.tar.gz busybox-w32-d7354df169603807fe2ac4f8a0f9f72c9703184f.tar.bz2 busybox-w32-d7354df169603807fe2ac4f8a0f9f72c9703184f.zip |
awk: evaluate all, even superfluous function args
function old new delta
evaluate 3128 3135 +7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 873cc3680..3c230393f 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -87,11 +87,17 @@ BEGIN { | |||
87 | a=2 | 87 | a=2 |
88 | print v (a) | 88 | print v (a) |
89 | }' | 89 | }' |
90 | testing "'v (a)' is not a function call, it is a concatenation" \ | 90 | testing "awk 'v (a)' is not a function call, it is a concatenation" \ |
91 | "awk '$prg' 2>&1" \ | 91 | "awk '$prg' 2>&1" \ |
92 | "12\n" \ | 92 | "12\n" \ |
93 | "" "" | 93 | "" "" |
94 | 94 | ||
95 | prg='func f(){print"F"};func g(){print"G"};BEGIN{f(g(),g())}' | ||
96 | testing "awk unused function args are evaluated" \ | ||
97 | "awk '$prg' 2>&1" \ | ||
98 | "G\nG\nF\n" \ | ||
99 | "" "" | ||
100 | |||
95 | 101 | ||
96 | optional DESKTOP | 102 | optional DESKTOP |
97 | testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n" | 103 | testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n" |