Jump to content

Module:Television episode short description/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gonnym (talk | contribs) at 10:17, 18 October 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:Television episode short description]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_getShortDescription()
	self:preprocess_equals_many('{{#invoke:Television episode short description|getShortDescription|', '}}', {
		{'test=yes|', 'A television episode'},
		{'test=yes|series_name=Lost', 'An episode of \'\'Lost\'\''},
		{'test=yes|series_name=Lost|season_num=1', 'An episode of the first season of \'\'Lost\'\''},
		{'test=yes|series_name=Lost|season_num=5|episode_num=4', '4th episode of the fifth season of \'\'Lost\'\''},
		{'test=yes|series_name=[[Firefly (TV series)|Firefly]]|season_num=1|episode_num=1', '1st episode of the first season of \'\'Firefly\'\''},
		{'test=yes|series_name=Lost|season_num=3|episode_num=22 and 23|multi_episodes=yes', '22nd and 23rd episodes of the third season of \'\'Lost\'\''},
		{'test=yes|series_name=Randall and Hopkirk (Deceased)|season_num=1|episode_num=1|not_dab=yes', '1st episode of the first season of \'\'Randall and Hopkirk (Deceased)\'\''},
    }, {nowiki=1})
    
end

function p:test_sandbox_getShortDescription()
	self:preprocess_equals_many('{{#invoke:Television episode short description/sandbox|getShortDescription|', '}}', {
		{'test=yes', 'A television episode'},
		{'test=yes|series_name=Lost', 'An episode of \'\'Lost\'\''},
		{'test=yes|series_name=Lost|season_num=1', 'An episode of the first season of \'\'Lost\'\''},
		{'test=yes|series_name=Lost|season_num=5|episode_num=4', '4th episode of the fifth season of \'\'Lost\'\''},
		{'test=yes|series_name=[[Firefly (TV series)|Firefly]]|season_num=1|episode_num=1', '1st episode of the first season of \'\'Firefly\'\''},
		{'test=yes|series_name=Lost|season_num=3|episode_num=22 and 23|multi_episodes=yes', '22nd and 23rd episodes of the third season of \'\'Lost\'\''},
		{'test=yes|series_name=Randall and Hopkirk (Deceased)|season_num=1|episode_num=1|not_dab=yes', '1st episode of the first season of \'\'Randall and Hopkirk (Deceased)\'\''},
    }, {nowiki=1})
    
end

function p:test_sandbox_v_live()
	self:preprocess_equals_preprocess_many('{{#invoke:Television episode short description/sandbox|getShortDescription', '}}', '{{#invoke:Television episode short description|getShortDescription', '}}', {
		{'|test=yes'},
		{'|test=yes|series_name=Lost'},
		{'|test=yes|series_name=Lost |season_num=1'},
		{'|test=yes|series_name=Lost |season_num=5 |episode_num=4'},
		{'||test=yes|series_name=[[Firefly (TV series) |Firefly]] |season_num=1 |episode_num=1'},
		{'|test=yes|series_name=Lost |season_num=3 |episode_num=22 and 23 |multi_episodes=yes'},
		{'|test=yes|series_name=Randall and Hopkirk (Deceased) |season_num=1 |episode_num=1 |not_dab=yes'},
	}, {nowiki=1})

end

return p