<?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%3AInfobox_television%2Ftestcases</id>
	<title>Module:Infobox television/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%3AInfobox_television%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Infobox_television/testcases&amp;action=history"/>
	<updated>2026-04-18T19:49:57Z</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:Infobox_television/testcases&amp;diff=136996&amp;oldid=prev</id>
		<title>imported&gt;Gonnym at 12:29, 14 May 2022</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Infobox_television/testcases&amp;diff=136996&amp;oldid=prev"/>
		<updated>2022-05-14T12:29:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Unit tests for [[Module:Infobox television]]. Click talk page to run tests.&lt;br /&gt;
local p = require(&amp;#039;Module:UnitTests&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local function expandTemplate(template, value)&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	return frame:expandTemplate{title = template, args = value}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_01_is_infobox_title_equal_to_article_title()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=&amp;#039; .. expandTemplate(&amp;quot;Nowrap&amp;quot;, {&amp;quot;Long article title&amp;quot;}), &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=Long article &amp;lt;br&amp;gt;title&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=Long article &amp;lt;br &amp;gt;title&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=Long article &amp;lt;br/&amp;gt;title&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=Long article &amp;lt;br /&amp;gt;title&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=Long article &amp;lt;br/&amp;gt; title&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title (dab)|name=&amp;#039; .. expandTemplate(&amp;quot;Nowrap&amp;quot;, {&amp;quot;Long article title&amp;quot;}), &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title (dab)|name=Long article &amp;lt;br&amp;gt;title&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Title (not dab)|name=&amp;#039; .. expandTemplate(&amp;quot;Nowrap&amp;quot;, {&amp;quot;Title (not dab)&amp;quot;}), &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Title (not dab)|name=Title &amp;lt;br&amp;gt;(not dab)&amp;#039;, &amp;#039;&amp;#039;},		&lt;br /&gt;
		{&amp;#039;page_title_test=Test|name=Test&amp;#039;, &amp;#039;[[Category:Pages using infobox television with unnecessary name parameter]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Test (not dab)|name=Test (not dab)&amp;#039;, &amp;#039;[[Category:Pages using infobox television with unnecessary name parameter]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Test (dab)|name=Test&amp;#039;, &amp;#039;[[Category:Pages using infobox television with unnecessary name parameter]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Test|name=test&amp;#039;, &amp;#039;[[Category:Pages using infobox television with non-matching title]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=&amp;#039; .. expandTemplate(&amp;quot;Nowrap&amp;quot;, {&amp;quot;Long article Title&amp;quot;}), &amp;#039;[[Category:Pages using infobox television with non-matching title]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_title_test=Long article title|name=Long article &amp;lt;br/&amp;gt; Title&amp;#039;, &amp;#039;[[Category:Pages using infobox television with non-matching title]]&amp;#039;},&lt;br /&gt;
    }, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_02_has_display_title()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;page_test=Template:Italic title/doc&amp;#039;, &amp;#039;[[Category:Pages using infobox television with unnecessary manual displaytitle]]&amp;#039;},&lt;br /&gt;
		--- {&amp;#039;page_test=News2day&amp;#039;, &amp;#039;[[Category:Pages using infobox television with manual displaytitle]]&amp;#039;}, --Displaytitle -- need a new example&lt;br /&gt;
    }, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_03_are_image_auxiliary_values_used_for_no_image()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;image=test|image_size=1&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;image_size=1&amp;#039;, &amp;#039;[[Category:Pages using infobox television with image-related values without an image]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;image_upright=1&amp;#039;, &amp;#039;[[Category:Pages using infobox television with image-related values without an image]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;image_alt=test&amp;#039;, &amp;#039;[[Category:Pages using infobox television with image-related values without an image]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;alt=test&amp;#039;, &amp;#039;[[Category:Pages using infobox television with image-related values without an image]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;caption=test&amp;#039;, &amp;#039;[[Category:Pages using infobox television with image-related values without an image]]&amp;#039;},&lt;br /&gt;
    }, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_04_is_image_using_incorrect_syntax()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;image=image.jpg&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;image=File:image.jpg&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|image]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;image=[[File:image.jpg]]&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|image]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;image=Image:image.jpg&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|image]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;image=[[Image:image.jpg]]&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|image]]&amp;#039;},&lt;br /&gt;
    }, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_05_is_image_size_using_px()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;image=test|image_size=100&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;image=test|image_size=100px&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|image_size]]&amp;#039;},&lt;br /&gt;
    }, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_06_are_values_linked_or_formatted()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;language=English&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;language=[[English]]&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|language]]&amp;#039;},&lt;br /&gt;
	}, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_08_has_flag_icon()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;director=&amp;#039; .. expandTemplate(&amp;quot;USA&amp;quot;, {}) .. &amp;#039;test&amp;#039;, &amp;#039;[[Category:Pages using infobox television with flag icon]]&amp;#039;},&lt;br /&gt;
	}, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_09_are_dates_formatted_correctly()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;first_aired=&amp;#039; .. expandTemplate(&amp;quot;Start date&amp;quot;, {&amp;quot;1999&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;4&amp;quot;}), &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;released=&amp;#039; .. expandTemplate(&amp;quot;Start date&amp;quot;, {&amp;quot;1999&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;4&amp;quot;}), &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;last_aired=&amp;#039; .. expandTemplate(&amp;quot;End date&amp;quot;, {&amp;quot;1999&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;4&amp;quot;}), &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;last_aired=present&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;first_aired=4/3/1999&amp;#039;, &amp;#039;[[Category:Pages using infobox television with nonstandard dates]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;first_aired=March 4, 1999&amp;#039;, &amp;#039;[[Category:Pages using infobox television with nonstandard dates]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;released=4/3/1999&amp;#039;, &amp;#039;[[Category:Pages using infobox television with nonstandard dates]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;released=March 4, 1999&amp;#039;, &amp;#039;[[Category:Pages using infobox television with nonstandard dates]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;last_aired=March 4, 1999&amp;#039;, &amp;#039;[[Category:Pages using infobox television with nonstandard dates]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;last_aired=Present&amp;#039;, &amp;#039;[[Category:Pages using infobox television with nonstandard dates]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;last_aired=&amp;#039; .. expandTemplate(&amp;quot;Start date&amp;quot;, {&amp;quot;1999&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;4&amp;quot;}), &amp;#039;[[Category:Pages using infobox television with nonstandard dates]]&amp;#039;},&lt;br /&gt;
	}, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_10_is_italic_title_valid_value()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;italic_title=no&amp;#039;, &amp;#039;&amp;#039;},&lt;br /&gt;
		{&amp;#039;italic_title=n&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|Italic title]]&amp;#039;},&lt;br /&gt;
		{&amp;#039;italic_title=y&amp;#039;, &amp;#039;[[Category:Pages using infobox television with incorrectly formatted values|Italic title]]&amp;#039;},&lt;br /&gt;
    }, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_11_all_errors()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;validate_values&amp;#039;, {&lt;br /&gt;
		{&amp;#039;page_title_test=Test|name=Test|page_test=Template:Italic title/doc|image_size=1|series=Lost|director=&amp;#039; .. expandTemplate(&amp;quot;USA&amp;quot;, {}) .. &amp;#039;test|first_aired=4/3/1999|italic_title=y&amp;#039;, &amp;#039;[[Category:Pages using infobox television with unnecessary name parameter]][[Category:Pages using infobox television with unnecessary manual displaytitle]][[Category:Pages using infobox television with image-related values without an image]][[Category:Pages using infobox television with flag icon]][[Category:Pages using infobox television with nonstandard dates]][[Category:Pages using infobox television with incorrectly formatted values|Italic title]]&amp;#039;},&lt;br /&gt;
    }, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function handle_title(text)&lt;br /&gt;
	return &amp;quot;&amp;#039;&amp;#039;&amp;quot;.. text .. &amp;quot;&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test_20_above_title()&lt;br /&gt;
	self:preprocess_equals_sandbox_many(&amp;#039;{{#invoke:Infobox television&amp;#039;, &amp;#039;above_title&amp;#039;, {&lt;br /&gt;
		{&amp;#039;name=title&amp;#039;, handle_title(&amp;#039;title&amp;#039;)},&lt;br /&gt;
		{&amp;#039;name=title (dab)&amp;#039;, handle_title(&amp;#039;title (dab)&amp;#039;)},&lt;br /&gt;
		{&amp;#039;name=#title&amp;#039;, handle_title(&amp;#039;#title&amp;#039;)},&lt;br /&gt;
		{&amp;#039;page_test=Lost (TV series)&amp;#039;, handle_title(&amp;#039;Lost&amp;#039;)},&lt;br /&gt;
		{&amp;#039;page_test=I (Almost) Got Away With It|name=I (Almost) Got Away With It&amp;#039;, handle_title(&amp;#039;I (Almost) Got Away With It&amp;#039;)},&lt;br /&gt;
		{&amp;#039;page_test=I (Almost) Got Away With It&amp;#039;, handle_title(&amp;#039;I (Almost) Got Away With It&amp;#039;)},&lt;br /&gt;
		{&amp;#039;page_test=How to Live with Your Parents (For the Rest of Your Life)|name=How to Live with Your Parents (For the Rest of Your Life)&amp;#039;, handle_title(&amp;#039;How to Live with Your Parents (For the Rest of Your Life)&amp;#039;)},&lt;br /&gt;
		{&amp;#039;page_test=How to Live with Your Parents (For the Rest of Your Life)&amp;#039;, handle_title(&amp;#039;How to Live with Your Parents&amp;#039;)},&lt;br /&gt;
		{&amp;#039;page_test=Hashtag Like|italic_title=no&amp;#039;, handle_title(&amp;#039;#Like&amp;#039;)}, --Correct title&lt;br /&gt;
		{&amp;#039;page_test=Hashtag Like|name=#Like&amp;#039;, handle_title(&amp;#039;#Like&amp;#039;)}, --Correct title&lt;br /&gt;
		{&amp;#039;page_test=Das aktuelle sportstudio|italic_title=no&amp;#039;, handle_title(&amp;#039;das aktuelle sportstudio&amp;#039;)}, --Lowercase title&lt;br /&gt;
		{&amp;#039;page_test=Das aktuelle sportstudio|name=das aktuelle sportstudio&amp;#039;, handle_title(&amp;#039;das aktuelle sportstudio&amp;#039;)}, --Lowercase title&lt;br /&gt;
		{&amp;#039;page_test=News2day|italic_title=no&amp;#039;, handle_title(&amp;#039;news2day&amp;#039;)}, --Displaytitle&lt;br /&gt;
		{&amp;#039;page_test=News2day|name=news2day&amp;#039;, handle_title(&amp;#039;news2day&amp;#039;)}, --Displaytitle&lt;br /&gt;
		{&amp;#039;page_test=H2O (miniseries)|italic_title=no&amp;#039;, handle_title(&amp;#039;H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O&amp;#039;)}, --Displaytitle with special style&lt;br /&gt;
		{&amp;#039;page_test=H2O (miniseries)|name=H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O&amp;#039;, handle_title(&amp;#039;H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O&amp;#039;)}, --Displaytitle with special style&lt;br /&gt;
		{&amp;#039;page_test=Wednesday 9:30 (8:30 Central)|italic_title=no&amp;#039;, handle_title(&amp;#039;Wednesday 9:30 (8:30 Central)&amp;#039;)}, --Itatlic title|all=yes&lt;br /&gt;
	}, {nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Gonnym</name></author>
	</entry>
</feed>