Module:WikiProject assessment progression/testcases

This is an old revision of this page, as edited by Sasuke Sarutobi (talk | contribs) at 00:05, 4 December 2020 (Try calling a non-local function). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:WikiProject assessment progression]]. Click talk page to run tests.
local myModule = require('Module:WikiProject assessment progression')
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

function suite:assertSameType(expectedType, functionName)
	local outputType = type(functionName)
	self:assertEquals(expectedType, outputType)
end

-- Test to make sure test function itself is working
function suite:test_assertSameType_returns_correctly()
	self:assertSameType('number', 10)
end
--[[
function suite:test_percentComplete_outputs_number_as_string()
	local percentComplete = myModule.percentComplete(10,20)
	self:assertSameType('string', percentComplete)
end
--]]

function suite:test__main_outputs_number_as_string()
	local args = args or {}
	local main = myModule._main(args)
	self:assertSameType('string', main)
end

return suite