Module:Infobox television disambiguation check/testcases
Appearance
![]() | This is the test cases page for the module Module:Infobox television disambiguation check. Results of the test cases. |
-- Example Unit tests for [[Module:Bananas]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_main()
self:preprocess_equals_many('{{#invoke:Infobox television disambiguation check|main|', '}}', {
{'', "Debug: Error: Empty title.", "Debug: Using a valid format."},
{'Lost', "Debug: No disambiguation.", "Debug: Using a valid format."},
{'Lost (TV series)', "Debug: Using a valid format."},
{'Lost (TV program)', "Debug: Using a valid format."},
{'Lost (TV programme)', "Debug: Using a valid format."},
{'Lost (TV film)', "Debug: Using a valid format."},
{'Lost (film)', "Debug: Using a valid format."},
{'Lost (miniseries)', "Debug: Using a valid format."},
{'Lost (serial)', "Debug: Using a valid format."},
{'Lost (game show)', "Debug: Using a valid format."},
{'Lost (talk show)', "Debug: Using a valid format."},
{'Lost (web series)', "Debug: Using a valid format."},
{'The (206)', "Debug: Title on exception list."},
{'Cinderella (Apakah Cinta Hanyalah Mimpi?)', "Debug: Title on exception list."},
{'How to Live with Your Parents (For the Rest of Your Life)', "Debug: Title on exception list."},
{'I (Almost) Got Away With It', "Debug: Title on exception list."},
{'Monty Python: Almost the Truth (Lawyers Cut)', "Debug: Title on exception list."},
{'Randall and Hopkirk (Deceased)', "Debug: Title on exception list."}
})
end
function p:test_sandbox_main()
self:preprocess_equals_many('{{#invoke:Infobox television disambiguation check/sandbox|main|', '}}', {
{'', "Debug: Error: Empty title.", "Debug: Using a valid format."},
{'Lost', "Debug: No disambiguation.", "Debug: Using a valid format."},
{'Lost (TV series)', "Debug: Using a valid format."},
{'Lost (TV program)', "Debug: Using a valid format."},
{'Lost (TV programme)', "Debug: Using a valid format."},
{'Lost (TV film)', "Debug: Using a valid format."},
{'Lost (film)', "Debug: Using a valid format."},
{'Lost (miniseries)', "Debug: Using a valid format."},
{'Lost (serial)', "Debug: Using a valid format."},
{'Lost (game show)', "Debug: Using a valid format."},
{'Lost (talk show)', "Debug: Using a valid format."},
{'Lost (web series)', "Debug: Using a valid format."},
})
end
function p:extended_disamiguation_sandbox_main()
self:preprocess_equals_many('{{#invoke:Infobox television disambiguation check/sandbox|main|', '}}', {
{'Lost (2004 TV series)', "Debug: Using a valid format - true."},
{'Lost (American TV series)', "Debug: Using a valid format - true."},
{'Lost (2004 American TV series)', "Debug: Using a valid format - true."},
{'Lost (American 2004 TV series)', "Debug: Using a valid format - false."},
{'Lost (U.S. TV series)', "Debug: Using a valid format - false."},
})
end
function p:exception_list_sandbox_main()
self:preprocess_equals_many('{{#invoke:Infobox television disambiguation check/sandbox|main|', '}}', {
{'The (206)', "Debug: Title on exception list."},
{'Cinderella (Apakah Cinta Hanyalah Mimpi?)', "Debug: Title on exception list."},
{'How to Live with Your Parents (For the Rest of Your Life)', "Debug: Title on exception list."},
{'I (Almost) Got Away With It', "Debug: Title on exception list."},
{'Monty Python: Almost the Truth (Lawyers Cut)', "Debug: Title on exception list."},
{'Randall and Hopkirk (Deceased)', "Debug: Title on exception list."}
})
end
return p