Module Name:    src
Committed By:   rillig
Date:           Fri Jun 17 19:01:01 UTC 2022

Modified Files:
        src/tests/usr.bin/xlint: check-expect.lua

Log Message:
tests/lint: treat a missing .exp file like an empty one

Previously, a missing .exp file skipped all the checks, that is, the
tests wouldn't fail if there were some unexpected new message.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/tests/usr.bin/xlint/check-expect.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/check-expect.lua
diff -u src/tests/usr.bin/xlint/check-expect.lua:1.21 src/tests/usr.bin/xlint/check-expect.lua:1.22
--- src/tests/usr.bin/xlint/check-expect.lua:1.21	Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/check-expect.lua	Fri Jun 17 19:01:01 2022
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.21 2022/06/17 18:54:53 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.22 2022/06/17 19:01:01 rillig Exp $
 
 --[[
 
@@ -178,8 +178,7 @@ local function check_test(c_fname)
   local c_comment_locations, c_comments_by_location = load_c(c_fname)
   if c_comment_locations == nil then return end
 
-  local exp_messages = load_exp(exp_fname)
-  if exp_messages == nil then return end
+  local exp_messages = load_exp(exp_fname) or {}
 
   for _, exp_message in ipairs(exp_messages) do
     local c_comments = c_comments_by_location[exp_message.location] or {}

Reply via email to