!! Version 2
# Force the test runner to ensure the extension is loaded
!! functionhooks
af_unset
!! endfunctionhooks
# This file tests the #af_unset parser function
!! test
Test remove a top-level index
!! wikitext
{{#af_print: {{#af_unset: {{#af_list: a | b | c }} | 2 }} }}
!! html
!! end
!! test
Test remove a top-level index, keys not reset
!! wikitext
{{#af_print: {{#af_unset: {{#af_list: a | b | c }} | 1 }} }}
!! html
!! end
!! test
Test remove a nested index
!! wikitext
{{#af_print: {{#af_unset: {{#af_object: foo={{#af_object: bar=quz | far=buz }} }} | foo | bar }} }}
!! html
!! end
!! test
Test too few arguments
!! wikitext
{{#af_unset: {{#af_list: a | b | c }} }}
!! html
ArrayFunctions (#af_unset): Expected at least 2 positional parameters, 1 given.
!! end