Module:Protect/testcases: Difference between revisions

Content deleted Content added
No edit summary
:.
Line 1:
local p = require('Module:UnitTests')
local protect = require('Module:Protect')
 
local o = {}
function o.f1(a)
if not a then
error('missing argument')
end
return a
end
 
function o:f2(a)
if not a then
error('missing argument')
end
return a
end
 
function p:test_protect()
self:equals(
'.',
protect(o.f1)('Foo'),
'Foo'
)
self:equals(
':',
protect(o.f2)('Foo'),
'Foo'
)
self:equals(
'Success',