!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_join !! endfunctionhooks # This file tests the #af_join parser function !! test Test empty list gives the empty string !! wikitext {{#af_join: {{AF_EMPTY}} }} !! html !! end !! test Test join one-dimensional list without glue !! wikitext {{#af_join: {{#af_list: a | b | c }} }} !! html

abc

!! end !! test Test join one-dimensional list with simple glue !! wikitext {{#af_join: {{#af_list: a | b | c }} | - }} !! html

a-b-c

!! end !! test Test space escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \s }} !! html

a b c

!! end !! test Test newline escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \n }} !! html

a b c

!! end !! test Test newline backslash sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\ }} !! html

a\b\c

!! end !! test Test escaped escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\n }} !! html

a\nb\nc

!! end !! test Test escaped escaped escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\\n }} !! html

a\ b\ c

!! end !! test Test non-existent escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \b }} !! html

a\bb\bc

!! end !! test Test escaped non-existent escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\b }} !! html

a\bb\bc

!! end !! test Test join multi-dimensional list !! wikitext {{#af_join: {{#af_list: a | b | {{#af_list: c | d }} }} | \s }} !! html

a b c d

!! end !! test Test join deep multi-dimensional list !! wikitext {{#af_join: {{#af_list: a | b | {{#af_list: c | {{#af_list: d | e | {{#af_list: f }} }} }} }} | \s }} !! html

a b c d e f

!! end !! test Test join boolean !! wikitext {{#af_join: {{#af_list: {{#af_bool: yes}} | {{#af_bool: no}} }} | \s }} !! html

true false

!! end !! test Test too many parameters !! wikitext {{#af_join: {{#af_list: a | b | c }} | \s | yes }} !! html

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

!! end