ਮੌਡਿਊਲ:Documentation/preload-module-testcases
ਦਿੱਖ
Documentation based on Module:ScribuntoUnit.
require('strict')
local myModule = require('Module:MyModule') -- the module to be tested
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()
-- test functions must begin with "test"
function suite:testSomeCall()
self:assertEquals('expected value', myModule.someCall(123))
self:assertEquals('other expected value', myModule.someCall(456))
end
function suite:testSomeOtherCall()
self:assertEquals('expected value', myModule.someOtherCall(123))
self:assertEquals('other expected value', myModule.someOtherCall(456))
end
return suite