!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_trim !! endfunctionhooks # This file tests the #af_trim parser function !! test Test trim with exclamation mark !! wikitext {{#af_print: {{#af_map: {{#af_split: !a!, !b!, !c! }} | v | {{#af_trim: {{{v}}} | ! }} }} }} !! html !! end !! test Test with empty value !! wikitext {{#af_trim:|!}} !! html !! end !! test Test characters accepts escape sequence !! wikitext {{#af_trim: \sa\s | \s }} !! html

a

!! end !! test Test too few arguments !! wikitext {{#af_trim: a }} !! html

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

!! end !! test Test too many arguments !! wikitext {{#af_trim: a | \s | v }} !! html

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

!! end