• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Collapsible test case/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Collapsible test case
This is the template sandbox page for Template:Collapsible test case (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Template test case (sandbox)

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.

Contents

  • 1 Usage
  • 2 Examples
    • 2.1 Compare template and sandbox (default format)
    • 2.2 Compare two different templates (default format)
    • 2.3 Compare template and sandbox (rows format)
    • 2.4 Compare template and sandbox (columns format)
    • 2.5 Compare template and sandbox (inline format, show code)
  • 3 See also

Usage

edit

Basic syntax

{{collapsible test case
| [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

edit

Compare template and sandbox (default format)

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

{{ombox}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.

{{ombox/sandbox}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.

Compare two different templates (default format)

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

{{ombox}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.

{{tmbox}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.

Compare template and sandbox (rows format)

edit
Usage
{{collapsible test case
| _format = rows
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Output
{{ombox}}
{{ombox}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
{{ombox/sandbox}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.

Compare template and sandbox (columns format)

edit
Usage
{{collapsible test case
| _format = columns
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Output
{{ombox}}
Side by side comparison
{{ombox}}{{ombox/sandbox}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.

Compare template and sandbox (inline format, show code)

edit
Usage
{{collapsible test case
| _format = inline
| _showcode = yes
| _template1 = ombox
| text = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
}}
Output
{{ombox}}
  • {{ombox|text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.}} →
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.
  • {{ombox/sandbox|text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.}} →
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut tristique sagittis cursus.

See also

edit

Templates invoking Module:Template test case:

  • Template:Test case – a generalised test case template
  • Template:Testcase rows – for a table of test cases arranged in rows
  • Template:Testcase table – for a table of test cases arranged in columns
  • Template:Inline test case – for test cases with small invocations and small output
  • Template:Test case nowiki – for test cases from template invocations enclosed in <nowiki>...</nowiki> tags
  • Template:Nowiki template demo – for use in template documentation
The above documentation is transcluded from Template:Collapsible test case/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Collapsible_test_case/sandbox&oldid=669331200"
Last edited on 30 June 2015, at 13:29

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 30 June 2015, at 13:29 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop