Module:Fiction-based redirects to list entries category handler/testcases

-- Example Unit tests for Module:Fiction-based redirects to list entries category handler. Click talk page to run tests. local p = require('Module:UnitTests')

function p:test_01_1_general_live self:preprocess_equals_many(, {		{'test=Agents of S.H.I.E.L.D. episode redirects to lists', "Series name: Agents of S.H.I.E.L.D.\n\nArticle title: Agents of S.H.I.E.L.D.\n\nTemplate: Television episode redirect handler\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Doctor Who character redirects to lists', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Doctor Who element redirects to lists', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Doctor Who location redirects', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Stranger Things (TV series) character redirects to lists', "Series name: Stranger Things''\n\nArticle title: Stranger Things (TV series)\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"}, {'test=Lost (TV series) element redirects to lists', "Series name: Lost\n\nArticle title: Lost (TV series)\n\nTemplate: Fictional element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"}, {'test=Lost (TV series) location redirects', "Series name: Lost\n\nArticle title: Lost (TV series)\n\nTemplate: Fictional location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"} }) end

function p:test_01_2_general_sandbox self:preprocess_equals_many(, {		{'test=Agents of S.H.I.E.L.D. episode redirects to lists', "Series name: Agents of S.H.I.E.L.D.\n\nArticle title: Agents of S.H.I.E.L.D.\n\nTemplate: Television episode redirect handler\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Doctor Who character redirects to lists', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Doctor Who element redirects to lists', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Doctor Who location redirects', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Stranger Things (TV series) character redirects to lists', "Series name: Stranger Things''\n\nArticle title: Stranger Things (TV series)\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"}, {'test=Lost (TV series) element redirects to lists', "Series name: Lost\n\nArticle title: Lost (TV series)\n\nTemplate: Fictional element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"}, {'test=Lost (TV series) location redirects', "Series name: Lost\n\nArticle title: Lost (TV series)\n\nTemplate: Fictional location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"} }) end

function p:test_02_1_Arrowverse_specific_live self:preprocess_equals_many(, {		{'test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) element redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) episode redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Television episode redirect handler\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) location redirects', "Series name: Arrow''\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"}	}) end

function p:test_02_2_Arrowverse_specific_sandbox self:preprocess_equals_many(, {		{'test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) element redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) episode redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Television episode redirect handler\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) location redirects', "Series name: Arrow''\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"}	}) end

function p:test_03_1_no_italic_live self:preprocess_equals_many('', {		{'test=Marvel Cinematic Universe location redirects', "Series name: Marvel Cinematic Universe\n\nArticle title: Marvel Cinematic Universe\n\nTemplate: Fictional location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_03_2_no_italic_sandbox self:preprocess_equals_many('', {		{'test=Marvel Cinematic Universe location redirects', "Series name: Marvel Cinematic Universe\n\nArticle title: Marvel Cinematic Universe\n\nTemplate: Fictional location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_04_1_media_single_live self:preprocess_equals_many(, {		{'test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) element redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) location redirects', "Series name: Arrow''\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_04_2_media_single_sandbox self:preprocess_equals_many(, {		{'test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) element redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=Arrow (TV series) location redirects', "Series name: Arrow''\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse location redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_05_1_media_multi_live self:preprocess_equals_many(, {		{'media2=Film|test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'media2=Film|media3=Comics|test=Arrow (TV series) element redirects to lists', "Series name: Arrow''\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_05_2_media_multi_sandbox self:preprocess_equals_many(, {		{'media2=Film|test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'media2=Film|media3=Comics|test=Arrow (TV series) element redirects to lists', "Series name: Arrow''\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_06_1_main_category_live self:preprocess_equals_many(, {		{'test=Doctors character redirects to lists|main=Doctors (2000 TV series)', "Series name: Doctors\n\nArticle title: Doctors\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=No-series character redirects to lists|main=Lost (TV series)', "Series name: No-series''\n\nArticle title: No-series\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_06_2_main_category_sandbox self:preprocess_equals_many(, {		{'test=Doctors character redirects to lists|main=Doctors (2000 TV series)', "Series name: Doctors\n\nArticle title: Doctors\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=No-series character redirects to lists|main=Lost (TV series)', "Series name: No-series''\n\nArticle title: No-series\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_07_1_no_series_category_live self:preprocess_equals_many(, {		{'test=No-series character redirects to lists', "Series name: No-series\n\nArticle title: No-series\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=No-series episode redirects to lists', "Series name: No-series''\n\nArticle title: No-series\n\nTemplate: Television episode redirect handler\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

function p:test_07_2_no_series_category_sandbox self:preprocess_equals_many(, {		{'test=No-series character redirects to lists', "Series name: No-series\n\nArticle title: No-series\n\nTemplate: Fictional character redirect\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},		{'test=No-series episode redirects to lists', "Series name: No-series''\n\nArticle title: No-series\n\nTemplate: Television episode redirect handler\n\nCategories: &#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;"},	}) end

return p