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: treat a missing .exp file li...



details:   https://anonhg.NetBSD.org/src/rev/aa1d86cf03dc
branches:  trunk
changeset: 366832:aa1d86cf03dc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jun 17 19:01:01 2022 +0000

description:
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.

diffstat:

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

diffs (20 lines):

diff -r 3f975a58cf64 -r aa1d86cf03dc tests/usr.bin/xlint/check-expect.lua
--- a/tests/usr.bin/xlint/check-expect.lua      Fri Jun 17 18:54:53 2022 +0000
+++ b/tests/usr.bin/xlint/check-expect.lua      Fri Jun 17 19:01:01 2022 +0000
@@ -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 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 {}



Home | Main Index | Thread Index | Old Index