!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_map !! endfunctionhooks # This file tests the #af_map parser function !! test Test empty list !! wikitext {{#af_print: {{#af_map: {{AF_EMPTY}} | v | {{{v}}} }} }} !! html !! end !! test Test singleton list !! wikitext {{#af_print: {{#af_map: {{#af_list: a }} | v | {{{v}}}-edited }} }} !! html !! end !! test Test list of lists !! wikitext {{#af_print: {{#af_map: {{#af_list: {{#af_list: a }} | {{#af_list: b }} }} | v | {{#af_push: {{{v}}} | c }} }} }} !! html !! end !! test Test list of mixed unchanged !! wikitext {{#af_print: {{#af_map: {{#af_list: {{#af_list: a }} | foo }} | v | {{{v}}} }} }} !! html !! end !! test Test list of lists boolean !! wikitext {{#af_print: {{#af_map: {{#af_list: {{#af_list: a }} | {{#af_list: a }} | {{#af_list: a }} | b }} | v | {{#af_isarray: {{{v}}} }} }} }} !! html !! end !! test Test too few arguments !! wikitext {{#af_map: {{#af_list: {{#af_list: a }} | foo }} | v }} !! html

ArrayFunctions (#af_map): Expected at least 3 positional parameters, 2 given.

!! end !! test Test too many arguments !! wikitext {{#af_map: {{#af_list: {{#af_list: a }} | foo }} | v | {{{v}}} | d }} !! html

ArrayFunctions (#af_map): Expected at most 3 positional parameters, 4 given.

!! end