Content deleted Content added
Danmichaelo (talk | contribs) ←Created page with 'local ScribuntoUnit = require('Module:ScribuntoUnit') p = {} -------------------------------------------------------------------------------- -- Test assertEqu...' |
localise more globals |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1:
local ScribuntoUnit = require('Module:ScribuntoUnit')
local p = {}
--------------------------------------------------------------------------------
-- Test assertEquals
local function
local out = msg .. ' '
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)▼
▲ errmsg = 'Lua error: ' .. tostring(details)
end
if success
out = out .. 'OK'
else
Line 31 ⟶ 30:
function p.testAssertEqualsWithEqualStrings()
return
'Testing that assertEquals does not throw error for equal strings...',
'abc',
Line 42 ⟶ 41:
function p.testAssertEqualsWithUnequalStrings()
return
'Testing that assertEquals throws error for unequal strings...',
'abc',
|