mirror of
https://github.com/nmap/nmap.git
synced 2025-12-08 21:51:28 +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("#", ...)
|
local nargs = select("#", ...)
|
||||||
return function(suite)
|
return function(suite)
|
||||||
if not test(table.unpack(args,1,nargs)) then
|
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
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user