!! Version 2
# Force the test runner to ensure the extension is loaded
!! functionhooks
af_wildcard
!! endfunctionhooks
# This file tests the #af_wildcard parser function
!! test
Test simple list
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_list: a | b | c }} }} }}
!! html
!! end
!! test
Test simple two-dimensional list
!! wikitext
{{#af_print: {{#af_wildcard: {{#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_wildcard: {{#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_wildcard: {{#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_wildcard: {{#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 list with null value
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_list: }} }} }}
!! html
!! end
!! test
Test object with null value
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_object: a= }} }} }}
!! html
!! end
!! test
Test empty array
!! wikitext
{{#af_print: {{#af_wildcard: {{AF_EMPTY}} }} }}
!! html
!! end
!! test
Test list with a single element
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_list: a }} }} }}
!! html
!! end
!! test
Test object with a single element
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_object: a={{#af_list: a }} }} }} }}
!! html
!! end
!! test
Test single-dimensional list with null value
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_list: a | b | null }} }} }}
!! html
!! end
!! test
Test multiple empty arrays in object
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_object: a={{#af_list: }} | b={{#af_list: }} | c={{#af_list: }} }} }} }}
!! html
!! end
!! test
Test nested empty objects
!! wikitext
{{#af_print: {{#af_wildcard: {{#af_object: a={{#af_object:}} | b={{#af_object:}} }} }} }}
!! html
!! end