Module:Category handler/testcases
Appearance
![]() | This is the test cases page for the module Module:Category handler. Results of the test cases. |
-- Unit tests for [[Module:Category handler]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_template_testcases_page()
self:preprocess_equals_preprocess_many('{{#invoke:Category handler|main', '}}', '{{category handler', '}}', {
{[[]]},
{[[
| Somecat]]},
{[[
| Somecat
| page = Somearticle]]},
{[[
| Somecat
| page = File:Example/test]]},
{[[
| Somecat
| page = File:Example/test
| nocat = ]]},
{[[
| Somecat
| page = File:Example/test
| nocat = true]]},
{[[
| main = Category:Somecat1 Category:Somecat2
| 1 = Category:Somecat3 <!--For help, user and template space-->
| help = 1
| user = 1
| template = 1
| talk = <!--No categories on talk pages-->
| other = Category:Somecat4 <!--For all other namespaces-->
| nocat = {{{nocat|}}} <!--So "nocat=true/false" works-->]]},
{[[
| main = Category:Somecat1 Category:Somecat2
| 3 = Category:Somecat3 <!--For help, user and template space-->
| help = 3
| user = 3
| template = 3
| talk = <!--No categories on talk pages-->
| other = Category:Somecat4 <!--For all other namespaces-->
| nocat = {{{nocat|}}} <!--So "nocat=true/false" works-->]]},
{[[
| main = Category:Somecat1 Category:Somecat2
| 3 = Category:Somecat3 <!--For help, user and template space-->
| help = 3
| user = 3
| template = 3
| talk = <!--No categories on talk pages-->
| other = Category:Somecat4 <!--For all other namespaces-->
| nocat = {{{nocat|}}} <!--So "nocat=true/false" works-->
| page = Somearticle]]},
{[[
| other = Somecat]]},
{[[
| other = Somecat
| page = User talk:Example/Archive 5]]},
{[[
| other = Somecat
| page = User talk:Example/Archive 5
| nocat = false]]},
{[[
| other = Somecat
| categories = no]]},
{[[
| other = Somecat
| page = User talk:Example/Archive 5
| categories = yes]]},
{[[
| other = Somecat
| category2 = no]]},
{[[
| other = Somecat
| category2 = ]]},
{[[
| other = Somecat
| category2 = ¬]]},
{[[
| other = Somecat
| category2 = {{{category|¬}}}]]},
{[[
| other = Somecat
| page = User talk:Example/Archive 5
| category2 = yes]]}
})
end
return p