Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint tests/lint: do not interpret 'expect:' c...



details:   https://anonhg.NetBSD.org/src/rev/df88bfd82ec8
branches:  trunk
changeset: 366817:df88bfd82ec8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jun 17 07:06:50 2022 +0000

description:
tests/lint: do not interpret 'expect:' comments, only 'expect+-n:'

Only the tests in msg_*.c had used the short form of the 'expect:'
comments.  The other tests used the more detailed variant 'expect+n:' or
'expect-n:'.

diffstat:

 tests/usr.bin/xlint/check-expect.lua |  13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diffs (33 lines):

diff -r 227b30214d26 -r df88bfd82ec8 tests/usr.bin/xlint/check-expect.lua
--- a/tests/usr.bin/xlint/check-expect.lua      Fri Jun 17 06:59:16 2022 +0000
+++ b/tests/usr.bin/xlint/check-expect.lua      Fri Jun 17 07:06:50 2022 +0000
@@ -1,11 +1,11 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.18 2022/06/17 06:59:16 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.19 2022/06/17 07:06:50 rillig Exp $
 
 --[[
 
 usage: lua ./check-expect.lua *.c
 
-Check that the /* expect: ... */ comments in the .c source files match the
+Check that the /* expect+-n: ... */ comments in the .c source files match the
 actual messages found in the corresponding .exp files.
 
 ]]
@@ -60,15 +60,6 @@
       add_expectation(tonumber(offset), comment)
     end
 
-    -- TODO: Remove these comments for all tests, as they often contain
-    -- only the raw message ID, without the actual message text,
-    -- which makes them harder to understand without looking up more context.
-    for comment in line:gmatch("/%* expect: (.-) %*/") do
-      if not fname:match("^msg_") then
-        add_expectation(0, comment)
-      end
-    end
-
     pp_lineno = pp_lineno + 1
 
     local ppl_lineno, ppl_fname = line:match("^#%s*(%d+)%s+\"([^\"]+)\"")



Home | Main Index | Thread Index | Old Index