!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_group !! endfunctionhooks # This file tests the #af_group parser function !! test Test simple list !! wikitext {{#af_print: {{#af_group: {{#af_list: a | b | c }} }} }} !! html !! end !! test Test simple two-dimensional list !! wikitext {{#af_print: {{#af_group: {{#af_list: {{#af_list: a | b | c }} | {{#af_list: d | e | f }} | {{#af_list: g | h | i }} }} }} }} !! html !! end !! test Test simple object !! wikitext {{#af_print: {{#af_group: {{#af_object: a={{#af_list: a | b | c }} | b={{#af_list: d | e | f }} | c={{#af_list: g | h | i }} }} }} }} !! html !! end !! test Test nested object !! wikitext {{#af_print: {{#af_group: {{#af_object: a={{#af_object: a=a | b=b | c=c }} | b={{#af_object: a=d | b=e | c=f }} | c={{#af_object: a=g | b=h | c=i }} }} }} }} !! html !! end !! test Test mixed types object !! wikitext {{#af_print: {{#af_group: {{#af_object: a={{#af_object: a=a | b=b | c=c }} | b={{#af_object: a=d | b=e | c=f }} | c={{#af_object: a=g | b=h | c=i }} | d=foobar }} }} }} !! html !! end !! test Test empty array !! wikitext {{#af_print: {{#af_group: {{AF_EMPTY}} }} }} !! html

!! end !! test Test list with a single element !! wikitext {{#af_print: {{#af_group: {{#af_list: a }} }} }} !! html

!! end !! test Test object with a single element !! wikitext {{#af_print: {{#af_group: {{#af_object: a={{#af_list: a }} }} }} }} !! html !! end !! test Test multiple empty arrays in object !! wikitext {{#af_print: {{#af_group: {{#af_object: a={{#af_list: }} | b={{#af_list: }} | c={{#af_list: }} }} }} }} !! html !! end !! test Test nested empty objects !! wikitext {{#af_print: {{#af_group: {{#af_object: a={{#af_object:}} | b={{#af_object:}} }} }} }} !! html !! end !! test Test empty input !! wikitext {{#af_group: }} !! html

ArrayFunctions (#af_group): Could not match expected type array with actual type empty for parameter 1 ("").

!! end !! test Test single-dimensional list !! wikitext {{#af_print: {{#af_group: {{#af_list: x | y | z }} }} }} !! html !! end !! test Test single object with scalar values !! wikitext {{#af_print: {{#af_group: {{#af_object: key1=value1 | key2=value2 }} }} }} !! html !! end !! test Test group with invalid input type !! wikitext {{#af_group: invalidInput }} !! html

ArrayFunctions (#af_group): Could not match expected type array with actual type string for parameter 1 ("invalidInput").

!! end !! test Test empty nested arrays !! wikitext {{#af_print: {{#af_group: {{#af_list: {{#af_list: }} | {{#af_list: }} }} }} }} !! html !! end