Module:Params/testcases: Difference between revisions

Content deleted Content added
Update template names
Line 7:
=== Multi-purpose helper subtemplates ===
 
==== Helper subtemplate {{[[Module:Params/testcases/multitmulti|./multitmulti]]}} ====
The {{[[Module:Params/testcases/multitmulti|./multitmulti]]}} subtemplate allows to simulate in one single call both the incoming parameters and the parameters manually concatenated to <code>{{ml|params|...|''function''|...}}</code>, using a single hyphen (<code>-</code>) as a delimiter between the two groups. This allows to make general experiments directly from the preview window without having to edit separate templates.
 
For instance, writing
 
<syntaxhighlight lang="wikitext">{{module:params/testcases/multitmulti|
setting|i/p|<br />|: |list|
-|hello|world|foo=bar}}</syntaxhighlight>
Line 18:
will simulate a call with {{para|1|hello}}, {{para|2|world}}, and {{para|foo|bar}} to a template whose content is <syntaxhighlight lang="wikitext" inline>{{#invoke:params|setting|i/p|<br />|: |list}}</syntaxhighlight>, thus producing:
 
{{module:params/testcases/multitmulti|
setting|i/p|<br />|: |list|
-|hello|world|foo=bar}}
Line 35:
=== Miscellaneous helper subtemplates ===
 
==== Helper subtemplate {{[[Module:Params/testcases/print1tprint1|./print1tprint1]]}} ====
The {{[[Module:Params/testcases/print1tprint1|./print1tprint1]]}} subtemplate only echoes the first unnamed parameter passed and discards the others (i.e. simply {{param|1|}}).
 
== Testing single functions ==
Line 42:
=== Testing the <code>[[Module:Params#list|list]]</code> function ===
 
==== Helper subtemplate {{[[Module:Params/testcases/echotecho|./echotecho]]}} ====
The {{[[Module:Params/testcases/echotecho|./echotecho]]}} subtemplate calls the {{mfl|params|list}} function to echo the code it was called with.
 
Example:
 
{{Automarkup|{{Make code|<<module:params/testcases/echotecho!hello!world!foo{{=}}bar>>}}}}
 
== Dummies ==