Jump to content

Module:UnitTests/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ans (talk | contribs) at 12:47, 11 October 2017 (Created page with '-- Example Unit tests for Module:UnitTests. Click talk page to run tests. local p = require('Module:UnitTests') local frame0 = mw.getCurrentFrame() local fr...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- Example Unit tests for [[Module:UnitTests]]. Click talk page to run tests.
local p = require('Module:UnitTests')

local frame0 = mw.getCurrentFrame()
local frame0_getTitle = frame0:getTitle()
local getCurrentFrame_getTitle = mw.getCurrentFrame():getTitle()
local arg = ...

function p._test()
    return
		frame0:getTitle() .. " " ..
		frame0_getTitle .. " " ..
		getCurrentFrame_getTitle .. " " ..
		arg .. " " ..
		""
end

function p:test()
    self:preprocess_equals('{{#invoke:UnitTests/testcases | _test}}', '')
end

return p