Module:Television episode short description/testcases

-- Unit tests for Module:Television episode short description. Click talk page to run tests. local p = require('Module:UnitTests')

function p:test_1_1_descriptions_live self:preprocess_equals_many(, {		{, 'Television episode'},		{'series_name=Lost', 'Episode of Lost'},		{'series_name=Lost|season_num=1', 'Episode of the first season of Lost'},		{'series_name=Lost|season_num=5|episode_num=4', '4th episode of the fifth season of Lost'},		{'series_name=Firefly|season_num=1|season_num_uk=2|episode_num=1', '1st episode of the first season of Firefly'},		{'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)'},		{'series_name=Lost|special=yes', 'Special episode of Lost'},		{'series_name=Lost|special=Recap', 'Recap episode of Lost'},		{'series_name=WandaVision|limited=yes|episode_num=4', '4th episode of WandaVision'},		{'series_name=WandaVision|limited=yes|episode_num=4, 5', '4th and 5th episodes of WandaVision'},   }, {nowiki=1}) end

function p:test_1_2_descriptions_sandbox self:preprocess_equals_many(, {		{, 'Television episode'},		{'series_name=Lost', 'Episode of Lost'},		{'series_name=Lost|season_num=1', 'Episode of the first season of Lost'},		{'series_name=Lost|season_num=5|episode_num=4', '4th episode of the fifth season of Lost'},		{'series_name=Firefly|season_num=1|season_num_uk=2|episode_num=1', '1st episode of the first season of Firefly'},		{'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)'},		{'series_name=Lost|special=yes', 'Special episode of Lost'},		{'series_name=Lost|special=Recap', 'Recap episode of Lost'},		{'series_name=WandaVision|limited=yes|episode_num=4', '4th episode of WandaVision'},		{'series_name=WandaVision|limited=yes|episode_num=4, 5', '4th and 5th episodes of WandaVision'},   }, {nowiki=1}) end

function p:test_2_1_multi_part_episode_live self:preprocess_equals_many('', {		{'episode_num=22 and 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 / 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22, 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 &#x26; 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 - 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 - 23', '22nd and 23rd episodes of the third season of Lost'},   }, {nowiki=1}) end

function p:test_2_2_multi_part_episode_sandbox self:preprocess_equals_many('', {		{'episode_num=22 and 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 / 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22, 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 &#x26; 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 - 23', '22nd and 23rd episodes of the third season of Lost'},		{'episode_num=22 - 23', '22nd and 23rd episodes of the third season of Lost'},   }, {nowiki=1}) end

function p:test_3_1_uk_style_live self:preprocess_equals_many(, {		{, 'Episode of the second series of The Office'},				{'episode_num=4', '4th episode of the second series of The Office'},		{'episode_num=4 and 5', '4th and 5th episodes of the second series of The Office'},   }, {nowiki=1}) end

function p:test_3_1_uk_style_sandbox self:preprocess_equals_many(, {		{, 'Episode of the second series of The Office'},				{'episode_num=4', '4th episode of the second series of The Office'},		{'episode_num=4 and 5', '4th and 5th episodes of the second series of The Office'},   }, {nowiki=1}) end

function p:test_4_1_link_test_live self:preprocess_equals_many('', {		{'series_name=Lost', 'Episode of Lost'},		{'series_name=Firefly|season_num=1|episode_num=1', '1st episode of the first season of Firefly'},		{'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_4_2_link_test_sandbox self:preprocess_equals_many('', {		{'series_name=Lost', 'Episode of Lost'},		{'series_name=Firefly|season_num=1|episode_num=1', '1st episode of the first season of Firefly'},		{'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_5_1_decimal_numbers_live self:preprocess_equals_many('', {				{'season_num=3|episode_num=1.2', '1st episode of the third season of Lost'},		{'season_num=3|episode_num=113.22', '113th episode of the third season of Lost'},		{'season_num=1.2|episode_num=1.2', '1st episode of the first season of Lost'},		{'season_num=3|episode_num=22.1, 23.1', '22nd and 23rd episodes of the third season of Lost'},   }, {nowiki=1}) end

function p:test_5_2_decimal_numbers_sandbox self:preprocess_equals_many('', {				{'season_num=3|episode_num=1.2', '1st episode of the third season of Lost'},		{'season_num=3|episode_num=113.22', '113th episode of the third season of Lost'},		{'season_num=1.2|episode_num=1.2', '1st episode of the first season of Lost'},		{'season_num=3|episode_num=22.1, 23.1', '22nd and 23rd episodes of the third season of Lost'},   }, {nowiki=1}) end

function p:test_6_1_invalid_characters_episode_live self:preprocess_equals_many('', {					{'episode_num=14&#x3c;ref&#x3e;Episode test&#x3c;/ref&#x3e;', '14th episode of the third season of Lost'},		{'episode_num=14', '14th episode of the third season of Lost'},		{'episode_num=14', '14th episode of the third season of Lost'},		{'episode_num=&#x3c;ref&#x3e; Episode Profile&#x3c;/ref&#x3e;', 'Episode of the third season of Lost'},		{'episode_num=', 'Episode of the third season of Lost'},		{'episode_num=', 'Episode of the third season of Lost'},   }, {nowiki=1}) end

function p:test_6_2_invalid_characters_episode_sandbox self:preprocess_equals_many('', {					{'episode_num=14&#x3c;ref&#x3e;Episode test&#x3c;/ref&#x3e;', '14th episode of the third season of Lost'},		{'episode_num=14', '14th episode of the third season of Lost'},		{'episode_num=14', '14th episode of the third season of Lost'},		{'episode_num=&#x3c;ref&#x3e; Episode Profile&#x3c;/ref&#x3e;', 'Episode of the third season of Lost'},		{'episode_num=', 'Episode of the third season of Lost'},		{'episode_num=', 'Episode of the third season of Lost'},   }, {nowiki=1}) end

function p:test_7_1_invalid_characters_season_live self:preprocess_equals_many('', {			{'season_num=3', '14th episode of the third season of Lost'},		{'season_num=3', '14th episode of the third season of Lost'},		{'season_num=&#x3c;ref&#x3e; Episode Profile&#x3c;/ref&#x3e;', 'Episode of Lost'},		{'season_num=', 'Episode of Lost'},		{'season_num=', 'Episode of Lost'},   }, {nowiki=1}) end

function p:test_7_2_invalid_characters_season_sandbox self:preprocess_equals_many('', {			{'season_num=3', '14th episode of the third season of Lost'},		{'season_num=3', '14th episode of the third season of Lost'},		{'season_num=&#x3c;ref&#x3e; Episode Profile&#x3c;/ref&#x3e;', 'Episode of Lost'},		{'season_num=', 'Episode of Lost'},		{'season_num=', 'Episode of Lost'},   }, {nowiki=1}) end

function p:test_8_1_invalid_characters_series_live self:preprocess_equals_many('', {			{'series_name=Lost', '14th episode of the third season of Lost'},		{'series_name=', 'Television episode'},		{'series_name=Lost&#x3c;ref name="Episode title test"&#x3e;&#x3c;/ref&#x3e;', '14th episode of the third season of Lost'},		{'series_name=Lost', '14th episode of the third season of Lost'},		{'series_name=', 'Television episode'},		{'series_name=', 'Television episode'}   }, {nowiki=1}) end

function p:test_8_2_invalid_characters_series_sandbox self:preprocess_equals_many('', {			{'series_name=Lost', '14th episode of the third season of Lost'},		{'series_name=', 'Television episode'},		{'series_name=Lost&#x3c;ref name="Episode title test"&#x3e;&#x3c;/ref&#x3e;', '14th episode of the third season of Lost'},		{'series_name=Lost', '14th episode of the third season of Lost'},		{'series_name=', 'Television episode'},		{'series_name=', 'Television episode'}   }, {nowiki=1}) end

function p:test_9_1_categories_live self:preprocess_equals_many(, {		{, },		{'series_name=Lost', },		{'series_name=Lost|season_num=1', },		{'series_name=Lost|season_num=5|episode_num=4', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|special=yes|episode_num=22', },		{'series_name=Lost|season_num=3|limited=yes|episode_num=22', },		{'series_name=Lost|season_num=3|limited=yes|episode_num=22 and 23', ''},   }, {nowiki=1}) end

function p:test_9_2_categories_sandbox self:preprocess_equals_many(, {		{, },		{'series_name=Lost', },		{'series_name=Lost|season_num=1', },		{'series_name=Lost|season_num=5|episode_num=4', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|episode_num=22 and 23', },		{'series_name=Lost|season_num=3|special=yes|episode_num=22', },		{'series_name=Lost|season_num=3|limited=yes|episode_num=22', },		{'series_name=Lost|season_num=3|limited=yes|episode_num=22 and 23', ''},   }, {nowiki=1}) end

return p