Modulo:Panagtengngel ti kategoria/pangsubok

-- Panagsubok para iti [[Modulo:Panagtengngel ti kategoria]]. Pinduten ti tungtunganna a panid tapno maipataray ti panagsubok.
local p = require('Modulo:UnitTests')

function p:test_template_testcases_page()
    self:preprocess_equals_preprocess_many('{{#invoke:Panagtengngel ti kategoria|main', '}}', '{{panagtengngel ti kategoria', '}}', {
        {[[]]},
        {[[
| 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]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = no]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = no
| page = User:Example]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = no
| page = User:Example/test]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = only]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = only
| page = User:Example]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = only
| page = User:Example/test]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = no
| page = User:Example]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = no
| page = User:Example/test]]},
        {[[
| main = Category:Somecat1
| other = Category:Somecat2
| subpage = only
| page = User:Example/test]]},
    })
end

function p:test_blacklist()
    self:preprocess_equals_preprocess_many('{{#invoke:Panagtengngel ti kategoria|main', '}}', '{{panagtengngel ti kategoria', '}}', {
        {[[
| main = Category:Somecat1
| page = Main Page]]},
        {[[
| talk = Category:Somecat1
| page = Talk:Main Page]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Cascade-protected items]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Cascade-protected items/]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Cascade-protected items/Foo]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Cascade-protected itemsFoo]]},
        {[[
| talk = Category:Somecat1
| page = Wikipedia talk:Cascade-protected items]]},
        {[[
| user = Category:Somecat1
| page = User:UBX]]},
        {[[
| user = Category:Somecat1
| page = User talk:UBX]]},
        {[[
| user = Category:Somecat1
| page = User:UBX/Sociology]]},
        {[[
| user = Category:Somecat1
| page = User:UBX/Userboxes]]},
        {[[
| user = Category:Somecat1
| page = User talk:UBX/Userboxes]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Template messages]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Template messages/]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Template messagesFoo]]},
        {[[
| wikipedia = Category:Somecat1
| page = Wikipedia:Template messages/Cleanup]]},
        {[[
| talk = Category:Somecat1
| page = Talk:Jerusalem/Archive 2]]},
        {[[
| talk = Category:Somecat1
| page = Talk:Jerusalem/archive 2]]},
        {[[
| talk = Category:Somecat1
| page = Talk:Jerusalem]]},
    })
end
return p