<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.boywiki.org/media/index.php?action=history&amp;feed=atom&amp;title=Module%3ATmpl%2Ftestcases</id>
	<title>Module:Tmpl/testcases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.boywiki.org/media/index.php?action=history&amp;feed=atom&amp;title=Module%3ATmpl%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://www.boywiki.org/media/index.php?title=Module:Tmpl/testcases&amp;action=history"/>
	<updated>2026-06-19T20:50:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://www.boywiki.org/media/index.php?title=Module:Tmpl/testcases&amp;diff=8256&amp;oldid=prev</id>
		<title>UpgradeTest1: Created page with &quot;local p = require(&#039;Module:ScribuntoUnit&#039;):new() local m = require(&#039;Module:Tmpl&#039;)  local function callWithArgs(arg0, args) 	local templateArgs = {} 	if args then 		for k, v in pairs(args) do 			local n = tonumber(k) or 0 			if (n &gt;= 1) then 				templateArgs[n] = v 			end 		end 		templateArgs[0] = arg0 	end 	local frame = (mw.getCurrentFrame() 		:newChild{ args = templateArgs } 		:newChild{ args = {} }) 	return m.renderTmpl(frame) end  function p:testRenderTmpl() 	self:ass...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.boywiki.org/media/index.php?title=Module:Tmpl/testcases&amp;diff=8256&amp;oldid=prev"/>
		<updated>2021-12-21T22:10:48Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = require(&amp;#039;Module:ScribuntoUnit&amp;#039;):new() local m = require(&amp;#039;Module:Tmpl&amp;#039;)  local function callWithArgs(arg0, args) 	local templateArgs = {} 	if args then 		for k, v in pairs(args) do 			local n = tonumber(k) or 0 			if (n &amp;gt;= 1) then 				templateArgs[n] = v 			end 		end 		templateArgs[0] = arg0 	end 	local frame = (mw.getCurrentFrame() 		:newChild{ args = templateArgs } 		:newChild{ args = {} }) 	return m.renderTmpl(frame) end  function p:testRenderTmpl() 	self:ass...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = require(&amp;#039;Module:ScribuntoUnit&amp;#039;):new()&lt;br /&gt;
local m = require(&amp;#039;Module:Tmpl&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local function callWithArgs(arg0, args)&lt;br /&gt;
	local templateArgs = {}&lt;br /&gt;
	if args then&lt;br /&gt;
		for k, v in pairs(args) do&lt;br /&gt;
			local n = tonumber(k) or 0&lt;br /&gt;
			if (n &amp;gt;= 1) then&lt;br /&gt;
				templateArgs[n] = v&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		templateArgs[0] = arg0&lt;br /&gt;
	end&lt;br /&gt;
	local frame = (mw.getCurrentFrame()&lt;br /&gt;
		:newChild{ args = templateArgs }&lt;br /&gt;
		:newChild{ args = {} })&lt;br /&gt;
	return m.renderTmpl(frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:testRenderTmpl()&lt;br /&gt;
	self:assertEquals(&amp;#039;test a b c&amp;#039;, callWithArgs(&amp;#039;test $1 $2 $3&amp;#039;, { &amp;#039;a&amp;#039;, &amp;#039;b&amp;#039;, &amp;#039;c&amp;#039; }))&lt;br /&gt;
	self:assertEquals(&amp;#039;test a $3&amp;#039;, callWithArgs(&amp;#039;test $1 $3&amp;#039;, { &amp;#039;a&amp;#039;, &amp;#039;b&amp;#039; }))&lt;br /&gt;
	self:assertEquals(&amp;#039;test $1 b&amp;#039;, callWithArgs(&amp;#039;test $1 $2&amp;#039;, { [2] = &amp;#039;b&amp;#039; }))&lt;br /&gt;
	self:assertEquals(&amp;#039;test $1 $2&amp;#039;, callWithArgs(&amp;#039;test $1 $2&amp;#039;, {}))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>UpgradeTest1</name></author>
	</entry>
</feed>