Difference between revisions of "Template:Collapsible test case/doc"

From blackwiki
Jump to navigation Jump to search
imported>Mr. Stradivarius
(create based on Template:Testcase table/doc)
 
imported>Mr. Stradivarius
(add {{lua}})
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 +
{{lua|Module:Template test case}}
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
  

Revision as of 05:21, 3 December 2014

This template creates a test case of two or more templates contained in a collapsible box. If the outputs of all the templates is the same, the box is collapsed, but if any of them differ from each other the box is left uncollapsed. There are a variety of different formats and options that can be used.

Each template is called with the same parameters. All parameters passed to this template are passed through to the test-case templates, with the exception of parameters starting with an underscore character ("_"), which are reserved for internal use.

If no templates are specified explicitly, the module uses the base page of the current page as the first template, and its /sandbox subpage as the second template. If only one template is specified explicitly, its /sandbox subpage is used as the second template.

Usage

Basic syntax

{{testcase table
| [param1] = [value1]
| [param2] = [value2]
| [param3] = [value3]
...
}}

Full syntax

For the full syntax, see Template:Test case. This template is equivalent to that one with the |_collapsible= parameter set to "yes" by default.

Examples

{{collapsible test case
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
{{ombox}}

{{ombox}}

{{ombox/sandbox}}

Error: expandTemplate: template "ombox/sandbox" does not exist

{{collapsible test case
| _template1 = ombox
| _template2 = tmbox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
{{ombox}}

{{ombox}}

{{tmbox}}