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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user