Module:Infobox television/testcases

-- Unit tests for [[Module:Infobox television]]. Click talk page to run tests.
local p = require('Module:UnitTests')

local function expandTemplate(template, value)
	local frame = mw.getCurrentFrame()
	return frame:expandTemplate{title = template, args = value}
end

function p:test_01_is_infobox_title_equal_to_article_title()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'page_title_test=Long article title|name=' .. expandTemplate("Nowrap", {"Long article title"}), ''},
		{'page_title_test=Long article title|name=Long article <br>title', ''},
		{'page_title_test=Long article title|name=Long article <br >title', ''},
		{'page_title_test=Long article title|name=Long article <br/>title', ''},
		{'page_title_test=Long article title|name=Long article <br />title', ''},
		{'page_title_test=Long article title|name=Long article <br/> title', ''},
		{'page_title_test=Long article title (dab)|name=' .. expandTemplate("Nowrap", {"Long article title"}), ''},
		{'page_title_test=Long article title (dab)|name=Long article <br>title', ''},
		{'page_title_test=Title (not dab)|name=' .. expandTemplate("Nowrap", {"Title (not dab)"}), ''},
		{'page_title_test=Title (not dab)|name=Title <br>(not dab)', ''},		
		{'page_title_test=Test|name=Test', '[[Category:Pages using infobox television with unnecessary name parameter]]'},
		{'page_title_test=Test (not dab)|name=Test (not dab)', '[[Category:Pages using infobox television with unnecessary name parameter]]'},
		{'page_title_test=Test (dab)|name=Test', '[[Category:Pages using infobox television with unnecessary name parameter]]'},
		{'page_title_test=Test|name=test', '[[Category:Pages using infobox television with non-matching title]]'},
		{'page_title_test=Long article title|name=' .. expandTemplate("Nowrap", {"Long article Title"}), '[[Category:Pages using infobox television with non-matching title]]'},
		{'page_title_test=Long article title|name=Long article <br/> Title', '[[Category:Pages using infobox television with non-matching title]]'},
    }, {nowiki=1})
end

function p:test_02_has_display_title()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'', ''},
		{'page_test=Module:Infobox television/italic test6', '[[Category:Pages using infobox television with unnecessary manual displaytitle]]'}, -- {{Italic title}}
		{'page_test=Module:Infobox television/italic test1', '[[Category:Pages using infobox television with unnecessary manual displaytitle]]'}, -- {{Italic}}
		{'page_test=Module:Infobox television/italic test2', '[[Category:Pages using infobox television with unnecessary manual displaytitle]]'}, -- {{Italics}}
		{'page_test=Module:Infobox television/italic test3', '[[Category:Pages using infobox television with unnecessary manual displaytitle]]'}, -- {{Italictitle}}
		{'page_test=Module:Infobox television/italic test4', '[[Category:Pages using infobox television with unnecessary manual displaytitle]]'}, -- {{Italics title}}
		{'page_test=Module:Infobox television/italic test5', '[[Category:Pages using infobox television with manual displaytitle]]'}, -- {{DISPLAYTITLE}}
    }, {nowiki=1})
end

function p:test_03_are_image_auxiliary_values_used_for_no_image()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'image=test|image_size=1', ''},
		{'image_size=1', '[[Category:Pages using infobox television with image-related values without an image]]'},
		{'image_upright=1', '[[Category:Pages using infobox television with image-related values without an image]]'},
		{'image_alt=test', '[[Category:Pages using infobox television with image-related values without an image]]'},
		{'alt=test', '[[Category:Pages using infobox television with image-related values without an image]]'},
		{'caption=test', '[[Category:Pages using infobox television with image-related values without an image]]'},
    }, {nowiki=1})
end

function p:test_04_is_image_using_incorrect_syntax()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'image=image.jpg', ''},
		{'image=File:image.jpg', '[[Category:Pages using infobox television with incorrectly formatted values|image]]'},
		{'image=[[File:image.jpg]]', '[[Category:Pages using infobox television with incorrectly formatted values|image]]'},
		{'image=Image:image.jpg', '[[Category:Pages using infobox television with incorrectly formatted values|image]]'},
		{'image=[[Image:image.jpg]]', '[[Category:Pages using infobox television with incorrectly formatted values|image]]'},
    }, {nowiki=1})
end

function p:test_05_is_image_size_using_px()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'image=test|image_size=100', ''},
		{'image=test|image_size=100px', '[[Category:Pages using infobox television with incorrectly formatted values|image_size]]'},
    }, {nowiki=1})
end

function p:test_06_is_image_size_using_px()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'image=test|image_size=100', ''},
		{'image=test|image_size=100px', '[[Category:Pages using infobox television with incorrectly formatted values|image_size]]'},
    }, {nowiki=1})
end

-- function p:test_07_is_alt_name_in_italics()
-- 	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
-- 		{'alt_name=Another name', ''},
-- 		{"alt_name=''another name''", '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},

		
-- 		-- Single word name
-- 		{'alt_name=' .. expandTemplate("Plainlist", {"* ''First alt name''\n* ''Second alt name''\n* ''Third alt name''"}), ''},
-- 		{'alt_name=' .. expandTemplate("Plainlist", {"* First alt name\n* Second alt name\n* Third alt name"}), '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{'alt_name=' .. expandTemplate("Plainlist", {"* ''First alt name''\n* ''Second alt name'' *\nThird alt name"}), '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{'alt_name=' .. expandTemplate("Unbulleted list", {"''First alt name''", "''Second alt name''", "''Third alt name''"}), ''},
-- 		{'alt_name=' .. expandTemplate("Unbulleted list", {"''First alt name''", "''Second alt name''", "Third alt name"}), '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{"alt_name=''First alt name''<br>''Second alt name''<br>''Third alt name''", ''},
-- 		{"alt_name=''First alt name''<br>''Second alt name''<br>Third alt name", '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{"alt_name=''First alt name''<br />''Second alt name''<br />Third alt name", '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{"alt_name=''First alt name''<br/>''Second alt name''<br/>Third alt name", '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
		
-- 		-- Multi-word names
-- 		{'alt_name=' .. expandTemplate("Plainlist", {"* ''alt1''\n* ''alt2''\n* ''alt3''"}), ''},
-- 		{'alt_name=' .. expandTemplate("Plainlist", {"* alt1\n* alt2\n* alt3"}), '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{'alt_name=' .. expandTemplate("Plainlist", {"* ''alt1''\n* ''alt2'' *\nalt3"}), '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{'alt_name=' .. expandTemplate("Unbulleted list", {"''alt1''", "''alt2''", "''alt3''"}), ''},
-- 		{'alt_name=' .. expandTemplate("Unbulleted list", {"''alt1''", "''alt2''", "alt3"}), '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{"alt_name=''alt1''<br>''alt2''<br>''alt3''", ''},
-- 		{"alt_name=''alt1''<br>''alt2''<br>alt3", '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{"alt_name=''alt1''<br />''alt2''<br />alt3", '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 		{"alt_name=''alt1''<br/>''alt2''<br/>alt3", '[[Category:Pages using infobox television with incorrectly formatted values|alt_name]]'},
-- 	}, {nowiki=1})
-- end

function p:test_08_has_flag_icon()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'director=' .. expandTemplate("USA", {}) .. 'test', '[[Category:Pages using infobox television with flag icon]]'},
	}, {nowiki=1})
end

function p:test_09_is_country_name_valid()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'country=United States', ''},
		{'country=' .. expandTemplate("Plainlist", {'*France\n*United States'}), ''},
		{'country=U.S.A.', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=U.S.A', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=U.S.', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=U.S', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=USA', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=US', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=UK', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=U.K.', '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
		{'country=' .. expandTemplate("Plainlist", {'*France\n*USA'}), '[[Category:Pages using infobox television with incorrectly formatted values|country]]'},
	}, {nowiki=1})
end

function p:test_10_are_values_linked_or_formatted()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'language=English', ''},
		{'language=[[English]]', '[[Category:Pages using infobox television with incorrectly formatted values|language]]'},
	}, {nowiki=1})
end

function p:test_11_is_producer_used_correctly()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'producer=John Doe', ''},
		{'producer=[[Muiris Mac Conghail]]', ''},
		{'producer=John Doe<br>\'\'\'executive\'\'\'<br>Jane Doe', '[[Category:Pages using infobox television with incorrectly formatted values|producer]]'},
		{'producer=John Doe<br>\'\'\'associate\'\'\'<br>Jane Doe', '[[Category:Pages using infobox television with incorrectly formatted values|producer]]'},
		{'producer=John Doe<br>\'\'\'co-producer\'\'\'<br>Jane Doe', '[[Category:Pages using infobox television with incorrectly formatted values|producer]]'},
	}, {nowiki=1})
end

local function get_date(version)
	if version == "start" then
		return expandTemplate("Start date", {"1999", "3", "4"})
	else
		return expandTemplate("End date", {"1999", "3", "4"})
	end
end

function p:test_12_are_dates_formatted_correctly()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values', {
		{'', ''}, -- should pass
		{'first_aired=' .. get_date("start") .. '|last_aired=' .. get_date("end"), ''},
		{'first_aired=' .. get_date("start") .. '|last_aired=present', ''},
		{'released=' .. get_date("start"), ''},
		{'first_aired2=' .. get_date("start") .. '|last_aired2=present', ''},
		{'released2=' .. get_date("start"), ''},
		{'first_aired3=' .. get_date("start") .. '|last_aired3=present', ''},
		{'released3=' .. get_date("start"), ''},
		{'first_aired4=' .. get_date("start") .. '|last_aired4=present', ''},
		{'released4=' .. get_date("start"), ''},
		{'first_aired5=' .. get_date("start") .. '|last_aired5=present', ''},
		{'released5=' .. get_date("start"), ''},
		{'first_aired=Upcoming', ''},
		{'released=Upcoming', ''},
		{'first_aired=' .. get_date("start"), '[[Category:Pages using infobox television with missing dates]]'},
		{'last_aired=' .. get_date("end"), '[[Category:Pages using infobox television with missing dates]]'},
		{'last_aired=present', '[[Category:Pages using infobox television with missing dates]]'},
		{'first_aired=upcoming', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=bad data', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. expandTemplate("Start date and age", {"1999", "3", "4"}) .. '|last_aired=present', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|last_aired=' .. expandTemplate("Start and end dates", {"1939", "9", "1", "1945", "9", "2"}), '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. expandTemplate("Film date", {"1999", "3", "4"}) .. '|last_aired=present', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|last_aired=' ..expandTemplate("Film date", {"1999", "3", "4"}), '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=4/3/1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=4/3/1999|last_aired=present', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=March 4, 1999|last_aired=present', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'released=4/3/1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'released=March 4, 1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|last_aired=March 4, 1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|last_aired=Present', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|last_aired=' .. get_date("start"), '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|released=' .. get_date("start") .. 'last_aired=present', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'released=' .. get_date("start") .. '|last_aired=present', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired2=' .. get_date("start"), '[[Category:Pages using infobox television with missing dates]]'},
		{'released2=March 4, 1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired3=' .. get_date("start"), '[[Category:Pages using infobox television with missing dates]]'},
		{'released3=March 4, 1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired4=' .. get_date("start"), '[[Category:Pages using infobox television with missing dates]]'},
		{'released4=March 4, 1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired5=' .. get_date("start"), '[[Category:Pages using infobox television with missing dates]]'},
		{'released5=March 4, 1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. get_date("start") .. '|last_aired=' .. get_date("end"), '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|last_aired=' .. get_date("end").. get_date("end"), '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. 'March 4, 1999' .. '|last_aired=' .. get_date("end"), '[[Category:Pages using infobox television with nonstandard dates]]'},
		{'first_aired=' .. get_date("start") .. '|last_aired=' .. get_date("end") .. 'March 4, 1999', '[[Category:Pages using infobox television with nonstandard dates]]'},
	}, {nowiki=1})
end

function p:test_13_are_dates_formatted_correctly_date_range()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'network=[[NBC]]', ''},
		{'network2=[[NBC]]', ''},
		{'network3=[[NBC]]', ''},
		{'network4=[[NBC]]', ''},
		{'network5=[[NBC]]', ''},
		{'network6=[[NBC]]', ''},

		{'channel=[[NBC]]', ''},
		{'channel2=[[NBC]]', ''},
		{'channel3=[[NBC]]', ''},
		{'channel4=[[NBC]]', ''},
		{'channel5=[[NBC]]', ''},
		{'channel6=[[NBC]]', ''},

		{'first_aired=Original series ' .. get_date("start") .. '|last_aired=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired]]'}, -- find 'original'
		{'first_aired=Revival series ' .. get_date("start") .. '|last_aired=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired]]'}, -- find 'revival'
		{'first_aired=' .. get_date("start") .. '|last_aired=Original series ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired]]'}, -- find 'original'
		{'first_aired=' .. get_date("start") .. '|last_aired=Revival series ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired]]'}, -- find 'revival'
		{'released=Original series ' .. get_date("start"), '[[Category:Pages using infobox television with incorrectly formatted values|released]]'}, -- find 'original'
		{'released=Revival series ' .. get_date("start"), '[[Category:Pages using infobox television with incorrectly formatted values|released]]'}, -- find 'revival'
		{'released=original series ' .. get_date("start"), '[[Category:Pages using infobox television with incorrectly formatted values|released]]'}, -- find 'original'
		{'released=revival series ' .. get_date("start"), '[[Category:Pages using infobox television with incorrectly formatted values|released]]'}, -- find 'revival'
		
		{'first_aired2=' .. get_date("start") .. 'Original series|last_aired2=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired2]]'}, -- find 'original'
		{'first_aired2=' .. get_date("start") .. '|last_aired2=Original series ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired2]]'}, -- find 'original'
		{'released2=' .. get_date("start") .. 'Original series', '[[Category:Pages using infobox television with incorrectly formatted values|released2]]'}, -- find 'original'
		{'channel2=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|channel2]]'}, -- find 'original'
		{'network2=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|network2]]'}, -- find 'original'

		{'first_aired3=' .. get_date("start") .. 'Original series|last_aired3=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired3]]'}, -- find 'original'
		{'first_aired3=' .. get_date("start") .. '|last_aired3=Original series ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired3]]'}, -- find 'original'
		{'released3=' .. get_date("start") .. 'Original series', '[[Category:Pages using infobox television with incorrectly formatted values|released3]]'}, -- find 'original'
		{'channel3=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|channel3]]'}, -- find 'original'
		{'network3=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|network3]]'}, -- find 'original'

		{'first_aired4=' .. get_date("start") .. 'Original series|last_aired4=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired4]]'}, -- find 'original'
		{'first_aired4=' .. get_date("start") .. '|last_aired4=Original series ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired4]]'}, -- find 'original'
		{'released4=' .. get_date("start") .. 'Original series', '[[Category:Pages using infobox television with incorrectly formatted values|released4]]'}, -- find 'original'
		{'channel4=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|channel4]]'}, -- find 'original'
		{'network4=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|network4]]'}, -- find 'original'

		{'first_aired5=' .. get_date("start") .. 'Original series|last_aired5=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired5]]'}, -- find 'original'
		{'first_aired5=' .. get_date("start") .. '|last_aired5=Original series ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired5]]'}, -- find 'original'
		{'released5=' .. get_date("start") .. 'Original series', '[[Category:Pages using infobox television with incorrectly formatted values|released5]]'}, -- find 'original'
		{'channel5=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|channel5]]'}, -- find 'original'
		{'network5=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|network5]]'}, -- find 'original'

		{'first_aired6=' .. get_date("start") .. 'Original series|last_aired6=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired6]]'}, -- find 'original'
		{'first_aired6=' .. get_date("start") .. '|last_aired6=Original series ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired6]]'}, -- find 'original'
		{'released6=' .. get_date("start") .. 'Original series', '[[Category:Pages using infobox television with incorrectly formatted values|released6]]'}, -- find 'original'
		{'channel6=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|channel6]]'}, -- find 'original'
		{'network6=Original series [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|network6]]'}, -- find 'original'

		{'released=\'\'NBC\'\' ' .. get_date("start"), '[[Category:Pages using infobox television with incorrectly formatted values|released]]'}, -- find italics
		{'first_aired=\'\'NBC\'\' ' .. get_date("start") .. '|last_aired=present', '[[Category:Pages using infobox television with incorrectly formatted values|first_aired]]'}, -- find italics
		{'first_aired=' .. get_date("start") .. '|last_aired=\'\'NBC\'\' ' .. get_date("end"), '[[Category:Pages using infobox television with incorrectly formatted values|last_aired]]'}, -- find italics
		{'channel=\'\'New series\'\' [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|channel]]'}, -- find italics
		{'network4=revival [[NBC]]', '[[Category:Pages using infobox television with incorrectly formatted values|network4]]'}, -- find 'revival'
		{'channel4=[[NBC]] revival', '[[Category:Pages using infobox television with incorrectly formatted values|channel4]]'}, -- find 'revival'

	}, {nowiki=1})
end

function p:test_14_is_italic_title_valid_value()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values|all_tests=no', {
		{'', ''},
		{'italic_title=no', ''},
		{'italic_title=n', '[[Category:Pages using infobox television with incorrectly formatted values|italic_title]]'},
		{'italic_title=y', '[[Category:Pages using infobox television with incorrectly formatted values|italic_title]]'},
    }, {nowiki=1})
end

function p:test_15_all_errors()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'validate_values', {
		{'page_title_test=Test|name=Test|page_test=Module:Infobox television/italic test6|image_size=1|series=Lost|director=' .. expandTemplate("USA", {}) .. 'test|first_aired=4/3/1999|italic_title=y', '[[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]]'},
    }, {nowiki=1})
end

local function handle_title(text)
	return "''".. text .. "''"
end

function p:test_20_above_title()
	self:preprocess_equals_sandbox_many('{{#invoke:Infobox television', 'above_title', {
		{'name=title', handle_title('title')},
		{'name=title (dab)', handle_title('title (dab)')},
		{'name=#title', handle_title('#title')},
		{'page_test=Lost (2004 TV series)', handle_title('Lost')},
		{'page_test=I (Almost) Got Away With It|name=I (Almost) Got Away With It', handle_title('I (Almost) Got Away With It')},
		{'page_test=I (Almost) Got Away With It', handle_title('I (Almost) Got Away With It')},
		{'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)', handle_title('How to Live with Your Parents (For the Rest of Your Life)')},
		{'page_test=How to Live with Your Parents (For the Rest of Your Life)', handle_title('How to Live with Your Parents')},
		{'page_test=Hashtag Like|italic_title=no', handle_title('#Like')}, --Correct title
		{'page_test=Hashtag Like|name=#Like', handle_title('#Like')}, --Correct title
		{'page_test=Das aktuelle sportstudio|italic_title=no', handle_title('das aktuelle sportstudio')}, --Lowercase title
		{'page_test=Das aktuelle sportstudio|name=das aktuelle sportstudio', handle_title('das aktuelle sportstudio')}, --Lowercase title
		{'page_test=News2day|italic_title=no', handle_title('news2day')}, --Displaytitle
		{'page_test=News2day|name=news2day', handle_title('news2day')}, --Displaytitle
		{'page_test=H2O (miniseries)|italic_title=no', handle_title('H<sub>2</sub>O')}, --Displaytitle with special style
		{'page_test=H2O (miniseries)|name=H<sub>2</sub>O', handle_title('H<sub>2</sub>O')}, --Displaytitle with special style
		{'page_test=Wednesday 9:30 (8:30 Central)|italic_title=no', handle_title('Wednesday 9:30 (8:30 Central)')}, --Itatlic title|all=yes
	}, {nowiki=1})
end

return p