Module:Params/testcases/tmulti: Difference between revisions
Appearance
Content deleted Content added
m Grufo moved page Module:Params/testcases/multi to Module:Params/testcases/tmulti: Add a “t” to the title for marking it as a template |
Update template name |
||
Line 3: | Line 3: | ||
|{{{{{|safesubst:}}}#invoke:params|concat_and_invoke|params| |
|{{{{{|safesubst:}}}#invoke:params|concat_and_invoke|params| |
||
cutting|{{{{{|safesubst:}}}#invoke:params|with_name_matching|^%d+$|with_value_matching|^%s*-%s*$| |
cutting|{{{{{|safesubst:}}}#invoke:params|with_name_matching|^%d+$|with_value_matching|^%s*-%s*$| |
||
mapping_values_by_calling| |
mapping_values_by_calling|module:params/testcases/tprint1|squeezing|cutting|0|-1|list_values}}|0}} |
||
}}</includeonly><noinclude>{{Documentation|heading=[[File:Test Template Info-Icon - Version (2).svg|50px|alt=|link=]] Template documentation}}</noinclude> |
}}</includeonly><noinclude>{{Documentation|heading=[[File:Test Template Info-Icon - Version (2).svg|50px|alt=|link=]] Template documentation}}</noinclude> |
Revision as of 04:12, 31 January 2024
This test template allows to simulate in one single call both the incoming parameters and the parameters possibly concatenated to {{#invoke:params|...|function|...}}
, using a single hyphen (-
) as a delimiter between the two groups. This allows to make general experiments directly from the preview window without having to edit separate templates.
Warning Please be aware that there are numerous limitations on what can be experimented using this template. In case of errors, please use a sandbox template.
Usage
For instance, writing
{{module:params/testcases/tmulti|
setting|i/p|<br />|: |list|
-|hello|world|foo=bar}}
will simulate a call with |1=hello
, |2=world
, and |foo=bar
to a template whose content is {{#invoke:params|setting|i/p|<br />|: |list}}
, thus producing:
Lua error: Module:Params, ‘cutting’: Left cut must be a number.