Template:UnitTest

From Terraria Wiki
Jump to navigation Jump to search
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:UnitTest/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:UnitTest/doc. (edit | history)

This simple helper template facilitates unit tests. It is to be used in template documentation and will categorize the page in Category:Templates with unit test failed if the unit test fails.

Usage

{{ unitTest | <expected result> | <actual result> }}

First unnamed parameter

Expected result, i.e. the hardcoded template output.

Second unnamed parameter

Actual result, i.e. the transclusion of the template.

Examples

Code Result
{{unitTest| 10 | {{sum|2|8}} }} 10
{{unitTest| 11 | {{sum|2|8}} }} 10 FAIL! (expected: 11)