!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_push !! endfunctionhooks # This file tests the #af_push parser function !! test Test push object to empty array !! wikitext {{#af_print: {{#af_push: {{AF_EMPTY}} | value }} }} !! html !! end !! test Test push to list !! wikitext {{#af_print: {{#af_push: {{#af_list: a }} | b }} }} !! html !! end !! test Test push to object !! wikitext {{#af_print: {{#af_push: {{#af_object: a=a }} | b }} }} !! html !! end !! test Test too few arguments !! wikitext {{#af_push: {{#af_list: a }} }} !! html

ArrayFunctions (#af_push): Expected at least 2 positional parameters, 1 given.

!! end !! test Test too many arguments !! wikitext {{#af_push: {{#af_list: a }} | b | c }} !! html

ArrayFunctions (#af_push): Expected at most 2 positional parameters, 3 given.

!! end