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_general self:preprocess_equals_sandbox_many('{{#invoke:Fiction-based redirects to list entries category handler', 'test', {		{'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: "},		{'test=Doctor Who character redirects to lists', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional character redirect\n\nCategories:  "},		{'test=Doctor Who element redirects to lists', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional element redirect\n\nCategories:  "},		{'test=Doctor Who location redirects', "Series name: Doctor Who\n\nArticle title: Doctor Who\n\nTemplate: Fictional location redirect\n\nCategories:  "},		{'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:  "}, {'test=Lost (2004 TV series) element redirects to lists', "Series name: Lost\n\nArticle title: Lost (2004 TV series)\n\nTemplate: Fictional element redirect\n\nCategories: "}, {'test=Lost (2004 TV series) location redirects', "Series name: Lost\n\nArticle title: Lost (2004 TV series)\n\nTemplate: Fictional location redirect\n\nCategories: "} }) end

function p:test_02_Arrowverse_specific self:preprocess_equals_sandbox_many('{{#invoke:Fiction-based redirects to list entries category handler', 'test', {		{'test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: "},		{'test=Arrow (TV series) element redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories:  "},		{'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:  "},		{'test=Arrow (TV series) location redirects', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse location redirect\n\nCategories:  "}	}) end

function p:test_03_no_italic self:preprocess_equals_sandbox_many('{{#invoke:Fiction-based redirects to list entries category handler', 'test|no_italic=yes', {		{'test=Marvel Cinematic Universe location redirects', "Series name: Marvel Cinematic Universe\n\nArticle title: Marvel Cinematic Universe\n\nTemplate: Fictional location redirect\n\nCategories: "},	}) end

function p:test_04_media_single self:preprocess_equals_sandbox_many('{{#invoke:Fiction-based redirects to list entries category handler', 'test|media=Television', {		{'test=Arrow (TV series) character redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse character redirect\n\nCategories: "},		{'test=Arrow (TV series) element redirects to lists', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse element redirect\n\nCategories:  "},		{'test=Arrow (TV series) location redirects', "Series name: Arrow\n\nArticle title: Arrow (TV series)\n\nTemplate: Arrowverse location redirect\n\nCategories:  "},	}) end

function p:test_05_media_multi self:preprocess_equals_sandbox_many('{{#invoke:Fiction-based redirects to list entries category handler', 'test|media=Television', {		{'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: "},		{'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:  "},	}) end

function p:test_06_main_category self:preprocess_equals_sandbox_many('{{#invoke:Fiction-based redirects to list entries category handler', 'test|media=Television', {		{'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: "},		{'test=No-series character redirects to lists|main=Lost (2004 TV series)', "Series name: No-series\n\nArticle title: No-series\n\nTemplate: Fictional character redirect\n\nCategories:  "},	}) end

function p:test_07_no_series_category self:preprocess_equals_sandbox_many('{{#invoke:Fiction-based redirects to list entries category handler', 'test|media=Television', {		{'test=No-series character redirects to lists', "Series name: No-series\n\nArticle title: No-series\n\nTemplate: Fictional character redirect\n\nCategories: "},		{'test=No-series episode redirects to lists', "Series name: No-series\n\nArticle title: No-series\n\nTemplate: Television episode redirect handler\n\nCategories:  "},	}) end

return p