Module:ScribuntoUnit/testcases: Difference between revisions

Content deleted Content added
No edit summary
localise more globals
 
(2 intermediate revisions by 2 users not shown)
Line 1:
local ScribuntoUnit = require('Module:ScribuntoUnit')
 
local p = {}
 
--------------------------------------------------------------------------------
Line 10:
local errmsg = ''
 
local success, details = pcall(function ()
local suite = ScribuntoUnit:new()
suite:assertEquals(expected, actual)
end)
if not success and (type(details) ~= 'table' or not details.ScribuntoUnit) then -- a real error, not a failed assertion
local errmsg = 'Lua error: ' .. tostring(details)
success = false
errmsg = 'Lua error: ' .. tostring(details)
end
if success and== not shouldFail then
out = out .. 'OK'
else