Jump to content

Module:Infobox television season name/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gonnym (talk | contribs) at 13:03, 15 July 2020. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Infobox television season name]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_01_1_checkPrevSeason_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|checkPrevSeason|', '}}', {
		{'title=Big Brother 2 (American season)', "true"},
		{'title=Lost (season 2)', "true"},
		{'title=The Office (American season 2)', "true"},
		{'title=The X Factor (British 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 season 55)', ""},
		{'title=The X Factor (British series 55)', ""},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series, season 55)', ""}
	})
end

function p:test_01_2_checkPrevSeason_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|checkPrevSeason|', '}}', {
		{'title=Big Brother 2 (American season)', "true"},
		{'title=Lost (season 2)', "true"},
		{'title=The Office (American season 2)', "true"},
		{'title=The X Factor (British 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 season 55)', ""},
		{'title=The X Factor (British series 55)', ""},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series, season 55)', ""}
	})
end

function p:test_02_1_checkNextSeason_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|checkNextSeason|', '}}', {
		{'title=Big Brother 2 (American season)', "true"},
		{'title=Lost (season 2)', "true"},
		{'title=The Office (American season 2)', "true"},
		{'title=The X Factor (British 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 season 55)', ""},
		{'title=The X Factor (British series 55)', ""},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series, season 55)', ""}
	})
end

function p:test_02_2_checkPrevSeason_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|checkNextSeason|', '}}', {
		{'title=Big Brother 2 (American season)', "true"},
		{'title=Lost (season 2)', "true"},
		{'title=The Office (American season 2)', "true"},
		{'title=The X Factor (British 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 season 55)', ""},
		{'title=The X Factor (British series 55)', ""},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series, season 55)', ""}
	})
end

function p:test_03_1_checkAll_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|checkAll|', '}}', {
		{'title=Big Brother 2 (American season)', "true"},
		{'title=Lost (season 2)', "true"},
		{'title=The Office (American season 2)', "true"},
		{'title=The X Factor (British 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 season 55)', ""},
		{'title=The X Factor (British series 55)', ""},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series, season 55)', ""}
	})
end

function p:test_03_2_checkAll_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|checkAll|', '}}', {
		{'title=Big Brother 2 (American season)', "true"},
		{'title=Lost (season 2)', "true"},
		{'title=The Office (American season 2)', "true"},
		{'title=The X Factor (British 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 season 55)', ""},
		{'title=The X Factor (British series 55)', ""},
		{'title=Teenage Mutant Ninja Turtles (1987 TV series, season 55)', ""}
	})
end

function p:test_04_1_getPrevSeasonArticle_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|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 season 2)', "[[The Office (American season 1)|Season 1]]"},
		{'title=The X Factor (British series 2)', "[[The X Factor (British 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]]"},
	})
end

function p:test_04_2_getPrevSeasonArticle_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|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 season 2)', "[[The Office (American season 1)|Season 1]]"},
		{'title=The X Factor (British series 2)', "[[The X Factor (British 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]]"},
	})
end

function p:test_05_1_getNextSeasonArticle_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|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 season 2)', "[[The Office (American season 3)|Season 3]]"},
		{'title=The X Factor (British series 2)', "[[The X Factor (British 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]]"},
	})
end

function p:test_05_2_getNextSeasonArticle_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|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 season 2)', "[[The Office (American season 3)|Season 3]]"},
		{'title=The X Factor (British series 2)', "[[The X Factor (British 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]]"},
	})
end

function p:test_06_1_getSeasonWord_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|getSeasonWord|', '}}', {
		{'title=Big Brother 2 (American season)', "season"},
		{'title=Lost (season 2)', "season"},
		{'title=The Office (American 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 series 2)', "series"},
		{'title=Love Island (2015 TV series, series 2)', "series"},
		{'title=Ben 10: Omniverse (story arc 1)', "story arc"},
		{'title=Big Brother Brasil 2', ""},
	})
end

function p:test_06_2_getSeasonWord_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|getSeasonWord|', '}}', {
		{'title=Big Brother 2 (American season)', "season"},
		{'title=Lost (season 2)', "season"},
		{'title=The Office (American 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 series 2)', "series"},
		{'title=Love Island (2015 TV series, series 2)', "series"},
		{'title=Ben 10: Omniverse (story arc 1)', "story arc"},
		{'title=Big Brother Brasil 2', ""},	
	})
end

function p:test_07_1_getInfoboxSubHeader_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|getInfoboxSubHeader|', '}}', {
		{'title=Big Brother 2 (American season)', ""},
		{'title=Lost (season 2)', "Season 2"},
		{'title=The Office (American 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 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"},
	})
end

function p:test_07_2_getInfoboxSubHeader_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|getInfoboxSubHeader|', '}}', {
		{'title=Big Brother 2 (American season)', ""},
		{'title=Lost (season 2)', "Season 2"},
		{'title=The Office (American 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 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"},
	})
end

function p:test_08_1_getListOfEpisodes_live()
	self:preprocess_equals_many('{{#invoke:Infobox television season name|getListOfEpisodes|', '}}', {
		{'title=Lost (season 1)', "[[List of Lost episodes|List of ''Lost'' episodes]]"},
		{'title=Lost (season 1)|link=List of Lost episodes', "[[List of Lost episodes|List of ''Lost'' episodes]]"},
		{'title=Teenage Mutant Ninja Turtles (2012 TV series, season 1)', "[[List of Teenage Mutant Ninja Turtles (2012 TV series) episodes|List of ''Teenage Mutant Ninja Turtles'' 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 ''Teenage Mutant Ninja Turtles'' episodes]]"},
		{'title=The Simpsons (season 1)', "[[List of The Simpsons episodes|List of ''The Simpsons'' 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 ''The Simpsons'' episodes (seasons 1–20)]]"},
		{'title=Doctor Who (season 1)', "[[List of Doctor Who episodes|List of ''Doctor Who'' episodes]]"},
		{'title=Doctor Who (season 1)|link=List of Doctor Who episodes (2005–present)', "[[List of Doctor Who episodes (2005–present)|List of ''Doctor Who'' episodes (2005–present)]]"},
		{'title=Strike the Blood II|link=List of Strike the Blood episodes', "[[List of Strike the Blood episodes|List of ''Strike the Blood'' episodes]]"},
		{"title=Lost (season 1)|link=List of Lost episodes|List of ''Lost'' episodes", "[[List of Lost episodes|List of ''Lost'' episodes]]"},
		{'title=Lost (season 1)|link=[[List of Lost episodes]]', ""},
		{'title=Lost (season 1)|link=[[List of Lost episodes|List of Lost episodes]]', ""},
		{'title=Lost (season 1)|link=x', ""},
	})
end

function p:test_08_2_getListOfEpisodes_sandbox()
	self:preprocess_equals_many('{{#invoke:Infobox television season name/sandbox|getListOfEpisodes|', '}}', {
		{'title=Lost (season 1)', "[[List of Lost episodes|List of ''Lost'' episodes]]"},
		{'title=Lost (season 1)|link=List of Lost episodes', "[[List of Lost episodes|List of ''Lost'' episodes]]"},
		{'title=Teenage Mutant Ninja Turtles (2012 TV series, season 1)', "[[List of Teenage Mutant Ninja Turtles (2012 TV series) episodes|List of ''Teenage Mutant Ninja Turtles'' 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 ''Teenage Mutant Ninja Turtles'' episodes]]"},
		{'title=The Simpsons (season 1)', "[[List of The Simpsons episodes|List of ''The Simpsons'' 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 ''The Simpsons'' episodes (seasons 1–20)]]"},
		{'title=Doctor Who (season 1)', "[[List of Doctor Who episodes|List of ''Doctor Who'' episodes]]"},
		{'title=Doctor Who (season 1)|link=List of Doctor Who episodes (2005–present)', "[[List of Doctor Who episodes (2005–present)|List of ''Doctor Who'' episodes (2005–present)]]"},
		{'title=Strike the Blood II|link=List of Strike the Blood episodes', "[[List of Strike the Blood episodes|List of ''Strike the Blood'' episodes]]"},
		{"title=Lost (season 1)|link=List of Lost episodes|List of ''Lost'' episodes", "[[List of Lost episodes|List of ''Lost'' episodes]]"},
		{'title=Lost (season 1)|link=[[List of Lost episodes]]', ""},
		{'title=Lost (season 1)|link=[[List of Lost episodes|List of Lost episodes]]', ""},
		{'title=Lost (season 1)|link=x', ""},
	})
end

return p