Module:Params/testcases/tmulti sandbox: Difference between revisions
From Kenshi Wiki
More actions
Prd created the page Module:Params/testcases/tmulti sandbox using a non-default content model "wikitext" |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{safesubst:<noinclude />#ifeq:{{safesubst:<noinclude />#invoke:params/sandbox|with_name_matching|^%d+$|with_value_matching|^%s*-%s*$|count}}|0 | |||
|{{Error|Error: There must be at least one unnamed parameter whose value is a hyphen (<code>-</code>).}} | |||
|{{safesubst:<noinclude />#invoke:params/sandbox|concat_and_invoke|params/sandbox| | |||
cutting|{{safesubst:<noinclude />#invoke:params/sandbox|with_name_matching|^%d+$|with_value_matching|^%s*-%s*$| | |||
mapping_by_calling|P1|names_and_values|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> |
Latest revision as of 05:09, 9 March 2025
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 sandbox|
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:
1: hello
2: world
foo: bar