Jump to content

Module:Infobox television season name/testcases2

From Wikipedia, the free encyclopedia
-- Unit tests for [[Module:Infobox television season name]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_01_checkPrevSeason()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|isPrevSeasonLinkValid|', '}}', {
		{'title=Big Brother 2 (American season)', 'true'},
		{'title=Lost season 2', 'true'},
		{'title=The Office (American TV series) season 2', 'true'},
		{'title=The X Factor (British TV series) series 2', 'true'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', 'true'},
		{'title=Love Island (2015 TV series) series 2', 'true'},
		{'title=Big Brother Brasil 2', 'true'},
		{'title=Big Brother 55 (American season)', ''},
		{'title=Lost season 55', ''},
		{'title=The Office (American TV series) season 55', ''},
		{'title=The X Factor (British TV series) series 55', ''},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 55', ''},
		{'title=Channel 4\'s Comedy Gala (2011 TV program)', ''},
	})
end

function p:test_02_checkNextSeason()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|isNextSeasonLinkValid|', '}}', {
		{'title=Big Brother 2 (American season)', 'true'},
		{'title=Lost season 2', 'true'},
		{'title=The Office (American TV series) season 2', 'true'},
		{'title=The X Factor (British TV series) series 2', 'true'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', 'true'},
		{'title=Love Island (2015 TV series) series 2', 'true'},
		{'title=Big Brother Brasil 2', 'true'},
		{'title=Big Brother 55 (American season)', ''},
		{'title=Lost season 55', ''},
		{'title=The Office (American TV series) season 55', ''},
		{'title=The X Factor (British TV series) series 55', ''},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 55', ''},
		{'title=Channel 4\'s Comedy Gala (2010 TV program)', ''},
	})
end

function p:test_03_checkAll()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|isPrevOrNextSeasonLinkValid|', '}}', {
		{'title=Big Brother 2 (American season)', 'true'},
		{'title=Lost season 2', 'true'},
		{'title=The Office (American TV series) season 2', 'true'},
		{'title=The X Factor (British TV series) series 2', 'true'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', 'true'},
		{'title=Love Island (2015 TV series) series 2', 'true'},
		{'title=Big Brother Brasil 2', 'true'},
		{'title=Big Brother 55 (American season)', ''},
		{'title=Lost season 55', ''},
		{'title=The Office (American TV series) season 55', ''},
		{'title=The X Factor (British TV series) series 55', ''},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 55', ''},
		{'title=Channel 4\'s Comedy Gala (2010 TV program)', ''},
	})
end

function p:test_04_getPrevSeasonArticle()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|getPrevSeasonArticle|', '}}', {
		{'title=Big Brother 2 (American season)', '[[Big Brother 1 (American season)|Season 1]]'},
		{'title=Lost season 2', '[[Lost season 1|Season 1]]'},
		{'title=The Office (American TV series) season 2', '[[The Office (American TV series) season 1|Season 1]]'},
		{'title=The X Factor (British TV series) series 2', '[[The X Factor (British TV series) series 1|Series 1]]'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', '[[Teenage Mutant Ninja Turtles (1987 TV series) season 1|Season 1]]'},
		{'title=Love Island (2015 TV series) series 2', '[[Love Island (2015 TV series) series 1|Series 1]]'},
		{'title=Big Brother Brasil 2', '[[Big Brother Brasil 1]]'},
		{'title=Channel 4\'s Comedy Gala (2011 TV program)', ''},
	})
end

function p:test_05_getNextSeasonArticle()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|getNextSeasonArticle|', '}}', {
		{'title=Big Brother 2 (American season)', '[[Big Brother 3 (American season)|Season 3]]'},
		{'title=Lost season 2', '[[Lost season 3|Season 3]]'},
		{'title=The Office (American TV series) season 2', '[[The Office (American TV series) season 3|Season 3]]'},
		{'title=The X Factor (British TV series) series 2', '[[The X Factor (British TV series) series 3|Series 3]]'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', '[[Teenage Mutant Ninja Turtles (1987 TV series) season 3|Season 3]]'},
		{'title=Love Island (2015 TV series) series 2', '[[Love Island (2015 TV series) series 3|Series 3]]'},
		{'title=Big Brother Brasil 2', '[[Big Brother Brasil 3]]'},
		{'title=Channel 4\'s Comedy Gala (2010 TV program)', ''},
	})
end

function p:test_06_getSeasonWord()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|getSeasonWord|', '}}', {
		{'title=Big Brother 2 (American season)', 'season'},
		{'title=Lost season 2', 'season'},
		{'title=The Office (American TV series) season 2', 'season'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', 'season'},
		{'title=Doctor Who series 2', 'series'},
		{'title=The X Factor (British TV series) series 2', 'series'},
		{'title=Love Island (2015 TV series) series 2', 'series'},
		{'title=Big Brother Brasil 2', ''},
		{'title=Ben 10: Omniverse story arc 1', 'story arc'},
		{'title=Doctor Who specials (2008–2010)', 'specials'},
	})
end

-- function p:test_07_getItalicTitle()
-- 	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|getItalicTitle|', '}}', {
-- 		{'title=Big Brother 2 (American season)', ''},
-- 		{'title=Lost season 2', ''},
-- 		{'title=The Office (American TV series) season 2', ''},
-- 		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', ''},
-- 		{'title=Doctor Who series 2', ''},
-- 		{'title=The X Factor (British TV series) series 2', ''},
-- 		{'title=Love Island (2015 TV series) series 2', ''},
-- 		{'title=Big Brother Brasil 2', ''},
-- 		{'title=Lost season 2|series_number=2', ''},
-- 		{'title=Lost season 2|series_number=5', ''},
-- 		{'title=Ben 10: Omniverse story arc 1', ''},
-- 		{'title=Doctor Who specials (2008–2010)', ''},
-- 	})
-- end

function p:test_08_getAboveTitle()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|getAboveTitle|', '}}', {
		{'title=Big Brother 2 (American season)', 'Big Brother 2'},
		{'title=Lost season 2', 'Lost'},
		{'title=The Office (American TV series) season 2', 'The Office'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', 'Teenage Mutant Ninja Turtles'},
		{'title=Doctor Who series 2', 'Doctor Who'},
		{'title=The X Factor (British TV series) series 2', 'The X Factor'},
		{'title=Love Island (2015 TV series) series 2', 'Love Island'},
		{'title=Big Brother Brasil 2', 'Big Brother Brasil 2'},
		{'title=Lost season 2|series_number=2', 'Lost'},
		{'title=Lost season 2|series_number=5', 'Lost'},
		{'title=Ben 10: Omniverse story arc 1', 'Ben 10: Omniverse'},
		{'title=Doctor Who specials (2008–2010)', 'Doctor Who'},
	})
end

function p:test_09_getSubHeader()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|getSubHeader|', '}}', {
		{'title=Big Brother 2 (American season)', ''},
		{'title=Lost season 2', 'Season 2'},
		{'title=The Office (American TV series) season 2', 'Season 2'},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', 'Season 2'},
		{'title=Doctor Who series 2', 'Series 2'},
		{'title=The X Factor (British TV series) series 2', 'Series 2'},
		{'title=Love Island (2015 TV series) series 2', 'Series 2'},
		{'title=Big Brother Brasil 2', ''},
		{'title=Lost season 2|series_number=2', 'Series 2'},
		{'title=Lost season 2|series_number=5', 'Series 5'},
		{'title=Ben 10: Omniverse story arc 1', 'Story arc 1'},
		{'title=Doctor Who specials (2008–2010)', '2008–2010 specials'},
	})
end

function p:test_10_getListOfEpisodes()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox2|getListOfEpisodes|', '}}', {
		{'title=Lost season 1', '[[List of Lost episodes|List of episodes]]'},
		{'title=Lost season 1|link=List of Lost episodes', '[[List of Lost episodes|List of episodes]]'},
		{'title=Teenage Mutant Ninja Turtles (2012 TV series) season 1', '[[List of Teenage Mutant Ninja Turtles (2012 TV series) episodes|List of episodes]]'},
		{'title=Teenage Mutant Ninja Turtles (2012 TV series) season 1|link=List of Teenage Mutant Ninja Turtles (2012 TV series) episodes', '[[List of Teenage Mutant Ninja Turtles (2012 TV series) episodes|List of episodes]]'},
		{'title=The Simpsons season 1', '[[List of The Simpsons episodes|List of episodes]]'},
		{'title=The Simpsons season 1|link=List of The Simpsons episodes (seasons 1–20)', '[[List of The Simpsons episodes (seasons 1–20)|List of episodes]]'},
		{'title=Doctor Who season 1', '[[List of Doctor Who episodes|List of episodes]]'},
		{'title=Doctor Who season 1|link=List of Doctor Who episodes (2005–present)', '[[List of Doctor Who episodes (2005–present)|List of episodes]]'},
		{'title=Strike the Blood II|link=List of Strike the Blood episodes', '[[List of Strike the Blood episodes|List of episodes]]'},
		{'title=Lost season 1|link=List of Lost episodes|List of \'\'Lost\'\' episodes', '[[List of Lost episodes|List of episodes]]'},
		{'title=Lost season 1|link=[[List of Lost episodes]]', '[[List of Lost episodes|List of episodes]]'},
		{'title=Lost season 1|link=[[List of Lost episodes|List of Lost episodes]]', '[[List of Lost episodes|List of episodes]]'},
		{'title=Top Gear (American TV series) season 2', '[[List of Top Gear (American TV series) episodes|List of episodes]]'},
		{'title=Top Gear (American TV series) season 2|link=List of Top Gear (U.S.) episodes', '[[List of Top Gear (U.S.) episodes|List of episodes]]'},
		{'title=Lost season 1|link=x', '[[x|List of episodes]]'},
		{'title=Back to Reality (TV series)', ''},
		{'title=MTV Roadies season 18|link=https://bn.m.wikipedia.org/wiki/%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE%E0%A6%A6%E0%A7%87%E0%A6%B6', ''},
	}, {nowiki=1})
end

return p