aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-07-27 11:47:47 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-07-27 11:47:47 +0300
commit30e8a37825c9b9e67c0cf440f7617508b7898c2b (patch)
tree81df2faabd09de798f93c73b07a0e961f4674e5e /test
parent3ddc932b0a808a4f5f55519ccf1d65f6caa41666 (diff)
downloadegawk-30e8a37825c9b9e67c0cf440f7617508b7898c2b.tar.gz
egawk-30e8a37825c9b9e67c0cf440f7617508b7898c2b.tar.bz2
egawk-30e8a37825c9b9e67c0cf440f7617508b7898c2b.zip
Add lint warning for `print "foo" > "foo" 1'.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog1
-rw-r--r--test/lintwarn.awk5
2 files changed, 6 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 93a42b10..6e7e3e01 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,6 +1,7 @@
2018-07-27 Arnold D. Robbins <arnold@skeeve.com>
* back89.ok, funstack.ok, gsubtst5.ok: Update after code changes.
+ * lintwarn.ok: Ditto.
2018-07-13 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/test/lintwarn.awk b/test/lintwarn.awk
index cea76bbc..d430a2b4 100644
--- a/test/lintwarn.awk
+++ b/test/lintwarn.awk
@@ -36,3 +36,8 @@ function zz(aa, aa)
return aa
}
@include ""
+BEGIN {
+ print "foo" > "foo" 1 # should warn
+ print "foo" > ("foo" 1) # should not warn
+ system("rm -f foo1 foo2")
+}