diff options
author | Denys Vlasenko | 2023-05-30 16:42:18 +0200 |
---|---|---|
committer | Denys Vlasenko | 2023-05-30 16:44:04 +0200 |
commit | 0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4 (patch) | |
tree | bdd3f15616a63a3261f5433c4df7bf83ce9f1be3 /testsuite | |
parent | fe0b7985483a93d3416e0e5c9e761b6ee1ba310b (diff) | |
download | busybox-0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4.zip busybox-0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4.tar.gz |
awk: fix precedence of = relative to ==
Discovered while adding code to disallow assignments to non-lvalues
function old new delta
parse_expr 936 991 +55
.rodata 105243 105247 +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 59/0) Total: 59 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 8ab1c68..cdab93d 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -547,4 +547,9 @@ testing 'awk does not split on CR (char 13)' \ 'word1 word2 word3\r word2 word3\r\n' \ '' 'word1 word2 word3\r' +testing "awk = has higher precedence than == (despite what gawk manpage claims)" \ + "awk 'BEGIN { v=1; print 2==v; print 2==v=2; print v; print v=3==3; print v}'" \ + '0\n1\n2\n1\n3\n' \ + '' '' + exit $FAILCOUNT |