Skabelon:Testcase
{{{1}}}
| ||||
| {{{2}}} | ||||
| {{{3}}} | ||||
| ||||
- For an easier-to-use version of this template, se Template:Test case.
| Denne skabelon, som kommer fra den engelske Wikipedia, er blevet afviklet og slettet hos dem. |
Brug
Use to compare a template with its sandbox. Pass the raw code in nowikis as the first unnamed parameter; the existing template as the second, and the sandbox as the third. The optional named parameter |id= is used as a heading (to describe the test being performed); if |id= is omitted, parameter 1 is used. The optional named parameter |layout= determines whether the live and sandbox outputs are displayed side by side or on top of each other. The default value is vertical (on top of each other). A value of horizontal will produce side by side output.
If the pair of test codes in parameters 2 and 3 both produce the same output, then the test case is displayed in a collapsed table with a green heading. If the test codes produce different output (this includes white space differences), then the test is displayed in an uncollapsed table with a yellow heading.
Note that some more complex templates may cause testcases to be highlighted even when their output is the same. The cause of this is under investigation...
Example
{{testcase
|id=title and url
|layout=horizontal
|<nowiki>{{citation|title=Test|url=http://example.org}}</nowiki>
|{{citation |title=Test|url=http://example.org}}
|{{citation/sandbox|title=Test|url=http://example.org}}
}}
If the sandbox code in parameter 3 gives the same output as the non-sandbox code in parameter 2:
| title and url | ||||
|---|---|---|---|---|
{{citation|title=Test|url=http://example.org}}
| ||||
| Test | ||||
| Test | ||||
| ||||
If sandbox gives different output:
| title and url | ||||
|---|---|---|---|---|
{{citation|title=Test|url=http://example.org}}
| ||||
| Test | ||||
| Test content of the differing output | ||||
| ||||
See also
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:Collapsible test case – for test cases collapsed by default if the results are the same
- Template:Test case nowiki – for test cases from template invocations enclosed in
<nowiki>...</nowiki>tags - Template:Nowiki template demo – for use in template documentation
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.









