Module:Params/testcases

File:Gelemental.svg.]]

This is the testcases page for checking the behaviour of Module:Params.

As the module provides most of its functionalities only when called by templates, this page uses helper subtemplates to do its tests. You can find a complete list of these here. Several helper subtemplates come in two versions, one that depends on {{ml|params|}} and one that depends on {{ml|params/sandbox|}}. Example templates, used by the documentation page, are available at /doc/examples.

General tests

= Helper subtemplate {{[[Module:Params/testcases/tdelimiters|./tdelimiters]]}} =

The {{./tdelimiters}} subtemplate allows to test the behaviour of delimiter strings between the arguments it was called with, invoking several functions of the module at once. For instance,

{{module:params/testcases/tdelimiters|foo|bar|Jupiter|hello=world}}

generates

{{module:params/testcases/tdelimiters|foo|bar|Jupiter|hello=world}}

{{A note}} An identical subtemplate that uses Module:Params/sandbox instead of Module:Params is available at {{./tdelimiters sandbox}}.

= Helper subtemplate {{[[Module:Params/testcases/tnumerical|./tnumerical]]}} =

The {{./tnumerical}} subtemplate allows to test the behaviour of functions that focus on numerical and sequential arguments. As these require at most two arguments, the template uses the {{para|#first}} and {{para|#second}} special parameters to do its tests. For instance,

{{module:params/testcases/tnumerical

| #first = 2

| #second = 2

| -2 = minus two

| 0 = zero

| 1 = one

| 2 = two

| 3 = three

| 19 = nineteen

| 20 = twenty

}}

generates

{{module:params/testcases/tnumerical

| #first = 2

| #second = 2

| -2 = minus two

| 0 = zero

| 1 = one

| 2 = two

| 3 = three

| 19 = nineteen

| 20 = twenty

}}

{{A note}} An identical subtemplate that uses Module:Params/sandbox instead of Module:Params is available at {{./tnumerical sandbox}}.

= Helper subtemplate {{[[Module:Params/testcases/tmaps|./tmaps]]}} =

The {{./tmaps}} subtemplate allows to test the behaviour of all the mapping_* and renaming_* class of modifiers. As the template generates a very large page its expansion is not shown here. For more information please visit its documentation page.

{{A note}} An identical subtemplate that uses Module:Params/sandbox instead of Module:Params is available at {{./tmaps sandbox}}.

= Helper subtemplate {{[[Module:Params/testcases/tcompare separated entries|./tcompare separated entries]]}} =

The {{./tcompare separated entries}} subtemplate compares the behaviours of Module:Params with that of Module:Separated entries. For instance,

{{ module:params/testcases/tcompare separated entries | one | two | three | foo | bar | Jupiter | hello = world }}

generates

{{ module:params/testcases/tcompare separated entries | one | two | three | foo | bar | Jupiter | hello = world }}

= Helper subtemplate {{[[Module:Params/testcases/tcoins|./tcoins]]}} =

The {{./tcoins}} subtemplate allows to experiment with the coins and unique_coins functions, which are called with the following arguments: one|two|three|foo=bar|hello=world. Therefore, transcluding the template with,

{{Module:Params/testcases/tcoins|foo|hello|2|3|foo}}

generates

{{module:params/testcases/tcoins|foo|hello|2|3|foo}}

{{A note}} An identical subtemplate that uses Module:Params/sandbox instead of Module:Params is available at {{./tcoins sandbox}}.

Testing individual functions

= Helper subtemplate {{[[Module:Params/testcases/techo|./techo]]}} =

The {{./techo}} subtemplate calls the {{mfl|params|list}} function to echo the code it was called with.

Example:

{{Automarkup|{{Make code|<>}}}}

Dummies

Deprecated tools

The following tools were developed with older versions of Module:Params in mind, and were later superseded by new functionalities in the module. They are kept here for historical reasons.

See also

  • ChangeLog of Module:Params
  • {{rel|Module:Params/doc/examples}}
  • [//en.wikipedia.org/w/index.php?title=Special:Search&search=insource%3A%2Finvoke%3Aparams%2Fi&limit=500&offset=0&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns829=1&sort=last_edit_desc Extensive “in source” search].

Category:Module test cases