!! Version 2
# Force the test runner to ensure the extension is loaded
!! functionhooks
af_slice
!! endfunctionhooks
# This file tests the #af_slice parser function
!! test
Test remove first element
!! wikitext
{{#af_print: {{#af_slice: {{#af_list: a | b | c }} | 1 }} }}
!! html
!! end
!! test
Test remove first two elements
!! wikitext
{{#af_print: {{#af_slice: {{#af_list: a | b | c }} | 2 }} }}
!! html
!! end
!! test
Test get last element
!! wikitext
{{#af_print: {{#af_slice: {{#af_list: a | b | c }} | -1 }} }}
!! html
!! end
!! test
Test get first element
!! wikitext
{{#af_print: {{#af_slice: {{#af_list: a | b | c }} | 0 | 1 }} }}
!! html
!! end
!! test
Test get first two element elements
!! wikitext
{{#af_print: {{#af_slice: {{#af_list: a | b | c }} | 0 | -1 }} }}
!! html
!! end
!! test
Test too few arguments
!! wikitext
{{#af_slice: {{#af_list: a | b | c }} }}
!! html
ArrayFunctions (#af_slice): Expected at least 2 positional parameters, 1 given.
!! end