Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-05-30 17:42:18 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-05-30 17:44:04 +0300
commit0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4 (patch)
treebdd3f15616a63a3261f5433c4df7bf83ce9f1be3 /testsuite
parentfe0b7985483a93d3416e0e5c9e761b6ee1ba310b (diff)
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)' \
'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