!! 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 }} | - }} !! htmla-b-c
!! end !! test Test space escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \s }} !! htmla b c
!! end !! test Test newline escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \n }} !! htmla b c
!! end !! test Test newline backslash sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\ }} !! htmla\b\c
!! end !! test Test escaped escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\n }} !! htmla\nb\nc
!! end !! test Test escaped escaped escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\\n }} !! htmla\ b\ c
!! end !! test Test non-existent escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \b }} !! htmla\bb\bc
!! end !! test Test escaped non-existent escape sequence !! wikitext {{#af_join: {{#af_list: a | b | c }} | \\b }} !! htmla\bb\bc
!! end !! test Test join multi-dimensional list !! wikitext {{#af_join: {{#af_list: a | b | {{#af_list: c | d }} }} | \s }} !! htmla 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 }} !! htmla b c d e f
!! end !! test Test join boolean !! wikitext {{#af_join: {{#af_list: {{#af_bool: yes}} | {{#af_bool: no}} }} | \s }} !! htmltrue false
!! end !! test Test too many parameters !! wikitext {{#af_join: {{#af_list: a | b | c }} | \s | yes }} !! htmlArrayFunctions (#af_join): Expected at most 2 positional parameters, 3 given.
!! end