<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AHighest_archive_number%2Ftestcases</id>
	<title>Module:Highest archive number/testcases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AHighest_archive_number%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Highest_archive_number/testcases&amp;action=history"/>
	<updated>2026-06-07T05:55:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Highest_archive_number/testcases&amp;diff=136474&amp;oldid=prev</id>
		<title>imported&gt;Mr. Stradivarius: use a better mw.title.new mock, as it was interfering with Module:Arguments, and use more realistic frame titles now that I have the structure figured out</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Highest_archive_number/testcases&amp;diff=136474&amp;oldid=prev"/>
		<updated>2019-10-08T15:44:16Z</updated>

		<summary type="html">&lt;p&gt;use a better mw.title.new mock, as it was interfering with &lt;a href=&quot;/research/Module:Arguments&quot; title=&quot;Module:Arguments&quot;&gt;Module:Arguments&lt;/a&gt;, and use more realistic frame titles now that I have the structure figured out&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Unit tests for [[Module:Highest archive number]]. Click on the talk page to&lt;br /&gt;
-- run the tests.&lt;br /&gt;
&lt;br /&gt;
local han = require(&amp;#039;Module:Highest archive number/sandbox&amp;#039;)&lt;br /&gt;
local ScribuntoUnit = require(&amp;#039;Module:ScribuntoUnit&amp;#039;)&lt;br /&gt;
local suite = ScribuntoUnit:new()&lt;br /&gt;
&lt;br /&gt;
-- Monkey patch mw.title.new&lt;br /&gt;
local existingPages = {}&lt;br /&gt;
local oldTitleNew = mw.title.new&lt;br /&gt;
mw.title.new = function(page)&lt;br /&gt;
	local title = oldTitleNew(page)&lt;br /&gt;
	rawset(title, &amp;quot;exists&amp;quot;, existingPages[page] ~= nil)&lt;br /&gt;
	return title&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Test data&lt;br /&gt;
local NO_ARCHIVES = {}&lt;br /&gt;
&lt;br /&gt;
local ARCHIVES_1_TO_5 = {&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 1&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 2&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 3&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 4&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 5&amp;quot;] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local ARCHIVES_3_TO_5 = {&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 3&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 4&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Talk:Foo/Archive 5&amp;quot;] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Tests&lt;br /&gt;
function suite:testNoArchives()&lt;br /&gt;
	existingPages = NO_ARCHIVES&lt;br /&gt;
	self:assertEquals(han._main(&amp;quot;Talk:Foo/Archive &amp;quot;), nil)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function suite:testArchivesStartingFromOne()&lt;br /&gt;
	existingPages = ARCHIVES_1_TO_5&lt;br /&gt;
	self:assertEquals(han._main(&amp;quot;Talk:Foo/Archive &amp;quot;), 5)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function suite:testArchivesStartingFromThreeWithCustomStart()&lt;br /&gt;
	existingPages = ARCHIVES_3_TO_5&lt;br /&gt;
	self:assertEquals(han._main(&amp;quot;Talk:Foo/Archive &amp;quot;, 3), 5)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function suite:testMain()&lt;br /&gt;
	existingPages = ARCHIVES_3_TO_5&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	local childFrame = frame:newChild{&lt;br /&gt;
		title = &amp;quot;Module:Highest archive number&amp;quot;,&lt;br /&gt;
		args = {&amp;quot;Talk:Foo/Archive &amp;quot;, start=&amp;quot;3&amp;quot;}&lt;br /&gt;
	}&lt;br /&gt;
	self:assertEquals(han.main(childFrame), 5)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function suite:testWrapperTemplate()&lt;br /&gt;
	existingPages = ARCHIVES_1_TO_5&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	local parentFrame = frame:newChild{&lt;br /&gt;
		title = &amp;quot;Template:Highest archive number&amp;quot;, args = {&amp;quot;Talk:Foo/Archive &amp;quot;}&lt;br /&gt;
	}&lt;br /&gt;
	local childFrame = parentFrame:newChild{&lt;br /&gt;
		title = &amp;quot;Module:Highest archive number&amp;quot;, args = {}&lt;br /&gt;
	}&lt;br /&gt;
	self:assertEquals(han.main(childFrame), 5)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return suite&lt;/div&gt;</summary>
		<author><name>imported&gt;Mr. Stradivarius</name></author>
	</entry>
</feed>