Mòideal:Template test case/doc
This is the documentation page for Mòideal:Template test case
Related pages |
---|
(deasbaireachd⧼tpt-languages-separator⧽ ⧼tpt-languages-separator⧽eachdraidh⧼tpt-languages-separator⧽ceanglaichean⧼tpt-languages-separator⧽doc⧼tpt-languages-separator⧽bogsa-gainmhich⧼tpt-languages-separator⧽cùisean deuchainn)
This module is currently protected from editing. See the protection policy and protection log for more details. Please discuss any changes on the talk page; you may submit an edit request to ask an administrator to make an edit if it is uncontroversial or supported by consensus. You may also request that this page be unprotected. |
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This module provides a framework for making templates which produce a template test case. While test cases can be made manually, using Lua-based templates such as the ones provided by this module has the advantage that the template arguments only need to be input once, thus reducing the effort involved in making test cases and reducing the possibility of errors in the input.
Ùsaid - Usage
This module should not usually be called directly. Instead, you should use one of the following templates:
Parameter-based templates:
- Teamplaid:Test case – for standard test cases
- Teamplaid:Testcase table – for test cases arranged side by side in columns
- Teamplaid:Testcase rows – for test cases arranged as rows in a table
- Teamplaid:Collapsible test case – for test cases that are collapsed by default if the results are the same
- Teamplaid:Inline test case – for test cases with small invocations and small output, that do not contain any line breaks
The only difference between these templates is their default arguments. For example, it is possible to display test cases side by side in Teamplaid:Testcase rows by specifying |_format=columns
Nowiki-based templates:
- Teamplaid:Test case nowiki – for test cases created from template code wrapped in nowiki tags (useful for displaying complex template invocations)
- Teamplaid:Nowiki template demo – for use in template documentation
It is also possible to use a format of {{#invoke:template test case|main|parameters}}
. This uses the same defaults as Teamplaid:Test case; please see that page for documentation of the parameters.
There is no direct interface to this module for other Lua modules. Lua modules should generally use Lua-based test case modules such as Mòideal:UnitTests or Mòideal:ScribuntoUnit. If it is really necessary to use this module, you can use frame:expandTemplate with one of the templates listed above.
Réiteachadh - Configuration
This module has a configuration module at Mòideal:Template test case/config. You can edit it to add new wrapper templates, or to change the messages that the module outputs.