Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Television episode redirect handler/testcases
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- Unit tests for [[Module:Television episode redirect handler]]. Click talk page to run tests. local p = require('Module:UnitTests') function p:test_01_1_redirect_categories_live() self:preprocess_equals_many('{{#invoke:Television episode redirect handler|main|test=yes|', '}}', { {"series_name=Arrow (TV series)|season_num=5|episode_num=6", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"restricted=yes", "R from television episode, R restricted, R to anchor 2, R with possibilities, R printworthy"}, {"birth_name=yes", "R from television episode, R from birth name, R to anchor 2, R printworthy"}, {"alt_name=yes", "R from television episode, R from alternative name, R to anchor 2, R printworthy"}, {"former_name=yes", "R from television episode, R from former name, R to anchor 2, R printworthy"}, {"short_name=yes", "R from television episode, R from short name, R to anchor 2, R printworthy"}, {"long_name=yes", "R from television episode, R from long name, R to anchor 2, R printworthy"}, {"title_name=yes", "R from television episode, R from name with title, R to anchor 2, R unprintworthy"}, {"alt_spelling=yes", "R from television episode, R from alternative spelling, R to anchor 2, R unprintworthy"}, {"to_diacritic=yes", "R from television episode, R to diacritic, R to anchor 2, R unprintworthy"}, {"incorrect_name=yes", "R from television episode, R from incorrect name, R to anchor 2, R unprintworthy"}, {"capitalisation=yes", "R from television episode, R from miscapitalisation, R to anchor 2, R unprintworthy"}, {"unneeded_dab=yes", "R from television episode, R from unnecessary disambiguation, R to anchor 2, R unprintworthy"}, {"primary=yes", "R from television episode, R to anchor 2, R avoided double redirect, R printworthy"}, {"merge=yes", "R from television episode, R to anchor 2, R from merge, R with possibilities, R printworthy"}, {"history=yes", "R from television episode, R to anchor 2, R with history, R with possibilities, R printworthy"}, {"draft_move=yes", "R from television episode, R from move, R from drafts, R to anchor 2, R unprintworthy"}, }) end function p:test_01_2_redirect_categories_sandbox() self:preprocess_equals_many('{{#invoke:Television episode redirect handler/sandbox|main|test=yes|', '}}', { {"series_name=Arrow (TV series)|season_num=5|episode_num=6", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"restricted=yes", "R from television episode, R restricted, R to anchor 2, R with possibilities, R printworthy"}, {"birth_name=yes", "R from television episode, R from birth name, R to anchor 2, R printworthy"}, {"alt_name=yes", "R from television episode, R from alternative name, R to anchor 2, R printworthy"}, {"former_name=yes", "R from television episode, R from former name, R to anchor 2, R printworthy"}, {"short_name=yes", "R from television episode, R from short name, R to anchor 2, R printworthy"}, {"long_name=yes", "R from television episode, R from long name, R to anchor 2, R printworthy"}, {"title_name=yes", "R from television episode, R from name with title, R to anchor 2, R unprintworthy"}, {"alt_spelling=yes", "R from television episode, R from alternative spelling, R to anchor 2, R unprintworthy"}, {"to_diacritic=yes", "R from television episode, R to diacritic, R to anchor 2, R unprintworthy"}, {"incorrect_name=yes", "R from television episode, R from incorrect name, R to anchor 2, R unprintworthy"}, {"capitalisation=yes", "R from television episode, R from miscapitalisation, R to anchor 2, R unprintworthy"}, {"unneeded_dab=yes", "R from television episode, R from unnecessary disambiguation, R to anchor 2, R unprintworthy"}, {"primary=yes", "R from television episode, R to anchor 2, R avoided double redirect, R printworthy"}, {"merge=yes", "R from television episode, R to anchor 2, R from merge, R with possibilities, R printworthy"}, {"history=yes", "R from television episode, R to anchor 2, R with history, R with possibilities, R printworthy"}, {"draft_move=yes", "R from television episode, R from move, R from drafts, R to anchor 2, R unprintworthy"}, }) end function p:test_02_1_title_handling_live() self:preprocess_equals_many('{{#invoke:Television episode redirect handler|main|test=yes|', '}}', { {"test_title=Guilty", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"test_title=Guilty (episode)", "R from television episode, R from incorrect disambiguation, R to anchor 2, R unprintworthy"}, {"test_title=Guilty (Arrow)|correct_disambiguation=Arrow", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"test_title=Guilty (Arrow episode)|correct_disambiguation=Arrow", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, }) end function p:test_02_2_title_handling_sandbox() self:preprocess_equals_many('{{#invoke:Television episode redirect handler/sandbox|main|test=yes|', '}}', { {"test_title=Guilty", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"test_title=Guilty (episode)", "R from television episode, R from incorrect disambiguation, R to anchor 2, R unprintworthy"}, {"test_title=Guilty (Arrow)|correct_disambiguation=Arrow", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"test_title=Guilty (Arrow episode)|correct_disambiguation=Arrow", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, }) end function p:test_03_1_title_section_handling_live() self:preprocess_equals_many('{{#invoke:Television episode redirect handler|main|test=yes|', '}}', { {"", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"anchor=yes", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"section=test", "R from television episode, R to section, R with possibilities, R printworthy"}, {"list=test", "R from television episode, R to list entry, R with possibilities, R printworthy"}, {"to_article=test", "R from television episode, R with possibilities, R printworthy"}, }) end function p:test_03_2_title_section_handling_sandbox() self:preprocess_equals_many('{{#invoke:Television episode redirect handler/sandbox|main|test=yes|', '}}', { {"", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"anchor=yes", "R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"section=test", "R from television episode, R to section, R with possibilities, R printworthy"}, {"list=test", "R from television episode, R to list entry, R with possibilities, R printworthy"}, {"to_article=test", "R from television episode, R with possibilities, R printworthy"}, }) end function p:test_04_1_multi_series_live() self:preprocess_equals_many('{{#invoke:Television episode redirect handler|main|test=yes|', '}}', { {"series_name=Arrow (TV series)|series_name2=The Flash (TV series)", "Arrow (TV series), The Flash (TV series), R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"series_name=Arrow (TV series)|series_name2=The Flash (TV series)|series_name3=Supergirl (TV series)", "Arrow (TV series), The Flash (TV series), Supergirl (TV series), R from television episode, R to anchor 2, R with possibilities, R printworthy"}, }) end function p:test_04_2_multi_series_sandbox() self:preprocess_equals_many('{{#invoke:Television episode redirect handler/sandbox|main|test=yes|', '}}', { {"series_name=Arrow (TV series)|series_name2=The Flash (TV series)", "Arrow (TV series), The Flash (TV series), R from television episode, R to anchor 2, R with possibilities, R printworthy"}, {"series_name=Arrow (TV series)|series_name2=The Flash (TV series)|series_name3=Supergirl (TV series)", "Arrow (TV series), The Flash (TV series), Supergirl (TV series), R from television episode, R to anchor 2, R with possibilities, R printworthy"}, }) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Television episode redirect handler/testcases/doc
(
edit
)