Difference between revisions of "Template:Category handler/testcases"

From blackwiki
Jump to navigation Jump to search
imported>Davidgothberg
(→‎Testing parameter 1: Testing the "all" parameter. All seems to work.)
imported>Davidgothberg
(→‎Testing parameter 1: Cleaning away some comments that are not valid anymore.)
Line 598: Line 598:
 
<pre>
 
<pre>
 
x{{cat handler
 
x{{cat handler
| 2 = Category:Somecat   <!--Categorize in the default namespaces-->
+
| 2 = Category:Somecat
| main =         <!--But not in main space-->
+
| main =  
| wikipedia = 2   <!--But add wikipedia space-->
+
| wikipedia = 2
 
| page = Help:Example
 
| page = Help:Example
 
}}x
 
}}x
  
 
x{{cat handler
 
x{{cat handler
| 1 = Category:Somecat   <!--Categorize in the default namespaces-->
+
| 1 = Category:Somecat
| main =         <!--But not in main space-->
+
| main =  
| wikipedia = 1   <!--But add wikipedia space-->
+
| wikipedia = 1
 
| page = Help:Example
 
| page = Help:Example
 
}}x
 
}}x
  
 
x{{cat handler/sandbox
 
x{{cat handler/sandbox
| 1 = Category:Somecat   <!--Categorize in the default namespaces-->
+
| 1 = Category:Somecat
| main =         <!--But not in main space-->
+
| main =  
| wikipedia = 1   <!--But add wikipedia space-->
+
| wikipedia = 1
 
| page = Help:Example
 
| page = Help:Example
 
}}x
 
}}x
 
</pre>
 
</pre>
 
x{{cat handler
 
x{{cat handler
| 2 = Category:Somecat   <!--Categorize in the default namespaces-->
+
| 2 = Category:Somecat
| main =         <!--But not in main space-->
+
| main =  
| wikipedia = 2   <!--But add wikipedia space-->
+
| wikipedia = 2
 
| page = Help:Example
 
| page = Help:Example
 
}}x
 
}}x
  
 
x{{cat handler
 
x{{cat handler
| 1 = Category:Somecat   <!--Categorize in the default namespaces-->
+
| 1 = Category:Somecat
| main =         <!--But not in main space-->
+
| main =  
| wikipedia = 1   <!--But add wikipedia space-->
+
| wikipedia = 1
 
| page = Help:Example
 
| page = Help:Example
 
}}x
 
}}x
  
 
x{{cat handler/sandbox
 
x{{cat handler/sandbox
| 1 = Category:Somecat   <!--Categorize in the default namespaces-->
+
| 1 = Category:Somecat
| main =         <!--But not in main space-->
+
| main =  
| wikipedia = 1   <!--But add wikipedia space-->
+
| wikipedia = 1
 
| page = Help:Example
 
| page = Help:Example
 
}}x
 
}}x
 
 
  
 
=== Testing the "all" parameter ===
 
=== Testing the "all" parameter ===

Revision as of 06:17, 25 November 2009

Testing {{cat handler/numbered}}

x{{cat handler/numbered}}x

x{{cat handler/numbered
| 1 = a
| 2 = b
| 3 = c
| data = 3
}}x

x{{cat handler/numbered
| 1 = a
| 2 = b
| 3 = c
| data = Somecat
}}x

x{{cat handler/numbered
| 1 = a
| 2 = b
| 3 = c
| data = [[Category:Test]]
}}x

xTemplate:Cat handler/numberedx

xTemplate:Cat handler/numberedx

xTemplate:Cat handler/numberedx

xTemplate:Cat handler/numberedx


Testing {{cat handler/blacklist}}

x{{cat handler/blacklist}}x

x{{cat handler/blacklist
| page = User talk:Example
}}x

x{{cat handler/blacklist
| page = User talk:Example/Archive 5
}}x

x{{cat handler/blacklist
| page = Wikipedia:Template messages/Wikipedia namespace
}}x

x-- This module contains the blacklist used by Module:Category handler. -- Pages that match Lua patterns in this list will not be categorised unless -- categorisation is explicitly requested.

return { '^Main Page$', -- don't categorise the main page.

-- Don't categorise the following pages or their subpages. -- "%f[/\0]" matches if the next character is "/" or the end of the string. '^Wikipedia:Cascade%-protected items%f[/\0]', '^User:UBX%f[/\0]', -- The userbox "template" space. '^User talk:UBX%f[/\0]',

-- Don't categorise subpages of these pages, but allow -- categorisation of the base page. '^Wikipedia:Template index/.*$',

-- Don't categorise archives. '/[aA]rchive', "^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$", }x

x-- This module contains the blacklist used by Module:Category handler. -- Pages that match Lua patterns in this list will not be categorised unless -- categorisation is explicitly requested.

return { '^Main Page$', -- don't categorise the main page.

-- Don't categorise the following pages or their subpages. -- "%f[/\0]" matches if the next character is "/" or the end of the string. '^Wikipedia:Cascade%-protected items%f[/\0]', '^User:UBX%f[/\0]', -- The userbox "template" space. '^User talk:UBX%f[/\0]',

-- Don't categorise subpages of these pages, but allow -- categorisation of the base page. '^Wikipedia:Template index/.*$',

-- Don't categorise archives. '/[aA]rchive', "^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$", }x

x-- This module contains the blacklist used by Module:Category handler. -- Pages that match Lua patterns in this list will not be categorised unless -- categorisation is explicitly requested.

return { '^Main Page$', -- don't categorise the main page.

-- Don't categorise the following pages or their subpages. -- "%f[/\0]" matches if the next character is "/" or the end of the string. '^Wikipedia:Cascade%-protected items%f[/\0]', '^User:UBX%f[/\0]', -- The userbox "template" space. '^User talk:UBX%f[/\0]',

-- Don't categorise subpages of these pages, but allow -- categorisation of the base page. '^Wikipedia:Template index/.*$',

-- Don't categorise archives. '/[aA]rchive', "^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$", }x

x-- This module contains the blacklist used by Module:Category handler. -- Pages that match Lua patterns in this list will not be categorised unless -- categorisation is explicitly requested.

return { '^Main Page$', -- don't categorise the main page.

-- Don't categorise the following pages or their subpages. -- "%f[/\0]" matches if the next character is "/" or the end of the string. '^Wikipedia:Cascade%-protected items%f[/\0]', '^User:UBX%f[/\0]', -- The userbox "template" space. '^User talk:UBX%f[/\0]',

-- Don't categorise subpages of these pages, but allow -- categorisation of the base page. '^Wikipedia:Template index/.*$',

-- Don't categorise archives. '/[aA]rchive', "^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$", }x

Testing {{cat handler}}

x{{cat handler}}x

x{{cat handler
| Somecat
}}x

x{{cat handler
| template = Somecat
}}x

x{{cat handler
| Somecat
| page = Somearticle
}}x

xx

xx

xSomecatx

xSomecatx


x{{cat handler
| Somecat
| page = File:Example/test
}}x

x{{cat handler
| Somecat
| page = File:Example/test
| nocat = 
}}x

x{{cat handler
| Somecat
| page = File:Example/test
| nocat = true
}}x

xSomecatx

xSomecatx

xx


x{{cat handler
| 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-->
}}x

x{{cat handler
| 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-->
}}x

x{{cat handler
| 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
}}x

xCategory:Somecat3x

xCategory:Somecat3x

xCategory:Somecat1 Category:Somecat2x


x{{cat handler
| other = Somecat
}}x

x{{cat handler
| other = Somecat
| page = User talk:Example/Archive 5
}}x

x{{cat handler
| other = Somecat
| page = User talk:Example/Archive 5
| nocat = false
}}x

xSomecatx

xx

xSomecatx


x{{cat handler
| other = Somecat
| categories = no
}}x

x{{cat handler
| other = Somecat
| page = User talk:Example/Archive 5
| categories = yes
}}x

xx

xSomecatx


x{{cat handler
| other = Somecat
| category = no
}}x

x{{cat handler
| other = Somecat
| category = 
}}x

x{{cat handler
| other = Somecat
| category = ¬
}}x

x{{cat handler
| other = Somecat
| category = {{{category|¬}}}
}}x

x{{cat handler
| other = Somecat
| page = User talk:Example/Archive 5
| category = yes
}}x

xSomecatx

xSomecatx

xSomecatx

xSomecatx

xx


Testing {{cat handler/sandbox}}

x{{cat handler/sandbox}}x

x{{cat handler/sandbox
| Somecat
}}x

x{{cat handler/sandbox
| template = Somecat
}}x

x{{cat handler/sandbox
| Somecat
| page = Somearticle
}}x

xx

xx

xSomecatx

xSomecatx


x{{cat handler/sandbox
| Somecat
| page = File:Example/test
}}x

x{{cat handler/sandbox
| Somecat
| page = File:Example/test
| nocat = 
}}x

x{{cat handler/sandbox
| Somecat
| page = File:Example/test
| nocat = true
}}x

xSomecatx

xSomecatx

xx


x{{cat handler/sandbox
| 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-->
}}x

x{{cat handler/sandbox
| 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-->
}}x

x{{cat handler/sandbox
| 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
}}x

xCategory:Somecat3x

xCategory:Somecat3x

xCategory:Somecat1 Category:Somecat2x


x{{cat handler/sandbox
| other = Somecat
}}x

x{{cat handler/sandbox
| other = Somecat
| page = User talk:Example/Archive 5
}}x

x{{cat handler/sandbox
| other = Somecat
| page = User talk:Example/Archive 5
| nocat = false
}}x

xSomecatx

xx

xSomecatx


x{{cat handler/sandbox
| other = Somecat
| categories = no
}}x

x{{cat handler/sandbox
| other = Somecat
| page = User talk:Example/Archive 5
| categories = yes
}}x

xx

xSomecatx


x{{cat handler/sandbox
| other = Somecat
| category = no
}}x

x{{cat handler/sandbox
| other = Somecat
| category = 
}}x

x{{cat handler/sandbox
| other = Somecat
| category = ¬
}}x

x{{cat handler/sandbox
| other = Somecat
| category = {{{category|¬}}}
}}x

x{{cat handler/sandbox
| other = Somecat
| page = User talk:Example/Archive 5
| category = yes
}}x

xSomecatx

xSomecatx

xSomecatx

xSomecatx

xx


Testing parameter 1

x{{cat handler
| 2 = Category:Somecat
| main = 
| wikipedia = 2
| page = Help:Example
}}x

x{{cat handler
| 1 = Category:Somecat
| main = 
| wikipedia = 1
| page = Help:Example
}}x

x{{cat handler/sandbox
| 1 = Category:Somecat
| main = 
| wikipedia = 1
| page = Help:Example
}}x

xx

xx

xx

Testing the "all" parameter

x{{cat handler/sandbox
| all = Category:Somecat1     <!--Category for all namespaces-->
| main = Category:Somecat2    <!--And use this in main space-->
| talk =           <!--But no extra category for talk pages-->
}}x

x{{cat handler/sandbox
| all = Category:Somecat1     <!--Category for all namespaces-->
| main = Category:Somecat2    <!--And use this in main space-->
| talk =           <!--But no extra category for talk pages-->
| page = An article
}}x

x{{cat handler/sandbox
| all = Category:Somecat1     <!--Category for all namespaces-->
| main = Category:Somecat2    <!--And use this in main space-->
| talk =           <!--But no extra category for talk pages-->
| page = Talk:Example
}}x

xCategory:Somecat1x

xCategory:Somecat1Category:Somecat2x

xCategory:Somecat1x


x{{cat handler/sandbox
| all = Category:Somecat1     <!--Category for all namespaces-->
| main = Category:Somecat2    <!--And use this in main space-->
| other = Category:Somecat3   <!--For the rest of the namespaces-->
| talk =           <!--But no extra category for talk pages-->
}}x

x{{cat handler/sandbox
| all = Category:Somecat1     <!--Category for all namespaces-->
| main = Category:Somecat2    <!--And use this in main space-->
| talk =           <!--But no extra category for talk pages-->
| other = Category:Somecat3   <!--For the rest of the namespaces-->
| page = An article
}}x

x{{cat handler/sandbox
| all = Category:Somecat1     <!--Category for all namespaces-->
| main = Category:Somecat2    <!--And use this in main space-->
| talk =           <!--But no extra category for talk pages-->
| other = Category:Somecat3   <!--For the rest of the namespaces-->
| page = Talk:Example
}}x

xCategory:Somecat1Category:Somecat3x

xCategory:Somecat1Category:Somecat2x

xCategory:Somecat1x