1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 05:01:29 +00:00

Be clear in unittest failures involving nil

This commit is contained in:
dmiller
2023-06-06 15:10:47 +00:00
parent 6a567c7c0a
commit 5ee110f3a5

View File

@@ -289,7 +289,11 @@ make_test = function(test, fmt)
local nargs = select("#", ...)
return function(suite)
if not test(table.unpack(args,1,nargs)) then
return false, string.format(fmt, table.unpack(listop.map(nsedebug.tostr, args),1,nargs))
local dbgargs = {}
for i = 1, nargs do
dbgargs[i] = nsedebug.tostr(args[i]):gsub("\n*$", '')
end
return false, string.format(fmt, table.unpack(dbgargs,1,nargs))
end
return true
end