Module:Infobox television season name/testcases

-- 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_sandbox_many('{{#invoke:Infobox television season name', '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=Hawaii Five-0 (2010 TV series) season 2', "true"},		{'title=Hawaii Five-0 (2010 TV series) season 9', "true"},		{'title=Hawaii Five-0 (2010 TV series) season 10', "true"},		{'title=Love Island (2015 TV series) series 2', "true"},		{'title=Big Brother Brasil 2', "true"},		{'title=66th NHK Kōhaku Uta Gassen', "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_02_checkNextSeason self:preprocess_equals_sandbox_many('{{#invoke:Infobox television season name', '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=Hawaii Five-0 (2010 TV series) season 2', "true"},		{'title=Hawaii Five-0 (2010 TV series) season 9', "true"},	--	{'title=Hawaii Five-0 (2010 TV series) season 10', "true"}, -- no article		{'title=Love Island (2015 TV series) series 2', "true"},		{'title=Big Brother Brasil 2', "true"},		{'title=66th NHK Kōhaku Uta Gassen', "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_sandbox_many('{{#invoke:Infobox television season name', '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=Hawaii Five-0 (2010 TV series) season 2', "true"},		{'title=Hawaii Five-0 (2010 TV series) season 9', "true"},		{'title=Hawaii Five-0 (2010 TV series) season 10', "true"},		{'title=Love Island (2015 TV series) series 2', "true"},		{'title=Big Brother Brasil 2', "true"},		{'title=66th NHK Kōhaku Uta Gassen', "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_sandbox_many('{{#invoke:Infobox television season name', 'getPrevSeasonArticle', {		{'title=Big Brother 2 (American season)', "Season 1"},		{'title=Lost season 2', "Season 1"},		{'title=The Office (American TV series) season 2', "Season 1"},		{'title=The X Factor (British TV series) series 2', "Series 1"},		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', "Season 1"},		{'title=Hawaii Five-0 (2010 TV series) season 2', "Season 1"},		{'title=Hawaii Five-0 (2010 TV series) season 9', "Season 8"},		{'title=Hawaii Five-0 (2010 TV series) season 10', "Season 9"}, {'title=Love Island (2015 TV series) series 2', "Series 1"}, {'title=Big Brother Brasil 2', "Big Brother Brasil 1"}, {'title=66th NHK Kōhaku Uta Gassen', "65th"}, {"title=Channel 4's Comedy Gala (2010 TV program)", ""}, }) end

function p:test_05_getNextSeasonArticle self:preprocess_equals_sandbox_many('{{#invoke:Infobox television season name', 'getNextSeasonArticle', {		{'title=Big Brother 2 (American season)', "Season 3"},		{'title=Lost season 2', "Season 3"},		{'title=The Office (American TV series) season 2', "Season 3"},		{'title=The X Factor (British TV series) series 2', "Series 3"},		{'title=Teenage Mutant Ninja Turtles (1987 TV series) season 2', "Season 3"},		{'title=Hawaii Five-0 (2010 TV series) season 2', "Season 3"},		{'title=Hawaii Five-0 (2010 TV series) season 9', "Season 10"},		{'title=Hawaii Five-0 (2010 TV series) season 10', "Season 11"}, {'title=Love Island (2015 TV series) series 2', "Series 3"}, {'title=Big Brother Brasil 2', "Big Brother Brasil 3"}, {'title=66th NHK Kōhaku Uta Gassen', "67th"}, {"title=Channel 4's Comedy Gala (2010 TV program)", ""}, }) end

function p:test_06_getSeasonWord self:preprocess_equals_sandbox_many('{{#invoke:Infobox television season name', '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=Hawaii Five-0 (2010 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=Ben 10: Omniverse story arc 1', "story arc"}, {'title=Big Brother Brasil 2', "season"}, {'title=Doctor Who specials (2008–2010)', "specials"}, {'title=66th NHK Kōhaku Uta Gassen', ""}, }) end

function p:test_07_getSubHeader self:preprocess_equals_sandbox_many('{{#invoke:Infobox television season name', 'getSubHeader', {		{'title=Big Brother 2 (American season)', "Season 2"},		{'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=Hawaii Five-0 (2010 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', "Season 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"}, {'title=66th NHK Kōhaku Uta Gassen', ""}, }) end

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