!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_isarray !! endfunctionhooks # This file tests the #af_isarray parser function !! test Test empty list gives true !! wikitext {{#af_isarray: {{AF_EMPTY}} }} !! html

boolean__^__1

!! end !! test Test singleton list gives true !! wikitext {{#af_isarray: {{#af_list: a }} }} !! html

boolean__^__1

!! end !! test Test list gives true !! wikitext {{#af_isarray: {{#af_list: a | b | c }} }} !! html

boolean__^__1

!! end !! test Test object gives true !! wikitext {{#af_isarray: {{#af_object: foo=bar }} }} !! html

boolean__^__1

!! end !! test Test boolean gives false !! wikitext {{#af_isarray: {{#af_bool: yes }} }} !! html

boolean__^__0

!! end !! test Test string gives false !! wikitext {{#af_isarray: foobar }} !! html

boolean__^__0

!! end !! test Test integer gives false !! wikitext {{#af_isarray: {{#af_int: 10 }} }} !! html

boolean__^__0

!! end !! test Test float gives false !! wikitext {{#af_isarray: {{#af_float: 10.12 }} }} !! html

boolean__^__0

!! end !! test Test too many arguments !! wikitext {{#af_isarray: {{#af_list: a }} | yes }} !! html

ArrayFunctions (#af_isarray): Expected at most 1 positional parameter, 2 given.

!! end