Jump to content

Module:Template invocation/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ans (talk | contribs) at 17:59, 19 November 2018 (Undid revision 869606084 by Ans (talk)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Example Unit tests for [[Module:Bananas]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local protect = require('Module:Protect')

function p:test_hello()
	local mTemplateInvocation = require('Module:Template invocation')
	local mTemplateInvocation2 = require('Module:Template invocation/sandbox')
	local a = {'bar', 'baz', abc = 'def'}; a[5]=555
	return protect(mTemplateInvocation.invocation)('foo', a) .. protect(mTemplateInvocation2.invocation)('foo', a)
	-- self:preprocess_equals('{{#invoke:Template invocation | hello}}', 'Hello, world!')
end

return p