Template:Test case/testcases

Illustrating correct usage
These cases show how this template could be used to document proper use of the template.

The wikicode:

Results in:

Using the sandbox version (Test case/sandbox):

Results in:

Illustrating incorrect usage
These cases show how this template could be used to document improper use of the template.

The wikicode:

Results in:

Using the sandbox version (Test case/sandbox):

Results in:

Cases with multiline wikicode
Some templates are best illustrated with multiline sample wikicode (because that's how they are best used in practice). In such cases, the value of the first anonymous parameter will contain newlines. Here are some examples showing what this looks like. They show how the template might be documented.

Notice how the newlines between the and  tags have been turned into spaces in the resulting "Wiki code". This might be acceptable in some cases but not in others.

is used here to fix formatting problems that arise when a test case involves right-floated content.

The wikicode:

Results in:

Using the sandbox version (Test case/sandbox):

Results in:

Using code=pre
Newlines in the first anonymous parameter can be preserved if the is used, as in the following example that is otherwise identical to the previous one.

Notice that the resulting "Wiki code" is shown as a block of preformatted text (because the usual element has been turned into a  element). This is generally preferable to having the newlines replaced by spaces.

The wikicode:

Results in:

Using the sandbox version (Test case/sandbox):

Results in: