aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-05-30 16:42:18 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2023-05-30 16:44:04 +0200
commit0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4 (patch)
treebdd3f15616a63a3261f5433c4df7bf83ce9f1be3 /testsuite
parentfe0b7985483a93d3416e0e5c9e761b6ee1ba310b (diff)
downloadbusybox-w32-0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4.tar.gz
busybox-w32-0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4.tar.bz2
busybox-w32-0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4.zip
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-xtestsuite/awk.tests5
1 files changed, 5 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index 8ab1c6891..cdab93d21 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -547,4 +547,9 @@ testing 'awk does not split on CR (char 13)' \
547 'word1 word2 word3\r word2 word3\r\n' \ 547 'word1 word2 word3\r word2 word3\r\n' \
548 '' 'word1 word2 word3\r' 548 '' 'word1 word2 word3\r'
549 549
550testing "awk = has higher precedence than == (despite what gawk manpage claims)" \
551 "awk 'BEGIN { v=1; print 2==v; print 2==v=2; print v; print v=3==3; print v}'" \
552 '0\n1\n2\n1\n3\n' \
553 '' ''
554
550exit $FAILCOUNT 555exit $FAILCOUNT