!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_difference !! endfunctionhooks # This file tests the #af_difference parser function !! test Test single array !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} }} }} !! html !! end !! test Test two disjunct arrays !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{#af_list: d | e | f }} }} }} !! html !! end !! test Test two identical arrays !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{#af_list: a | b | c }} }} }} !! html !! end !! test Test overlapping arrays !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{#af_list: c | d | e }} }} }} !! html !! end !! test Test disjunct multiple arrays !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{#af_list: d | e | f }} | {{#af_list: g | h | i }} }} }} !! html !! end !! test Test overlapping multiple arrays !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{#af_list: a | d | e }} | {{#af_list: a | f | g }} }} }} !! html !! end !! test Test overlapping multiple arrays 2 !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{#af_list: b }} | {{#af_list: c }} }} }} !! html !! end !! test Test empty array as the first input !! wikitext {{#af_print: {{#af_difference: {{AF_EMPTY}} | {{#af_list: a | b | c }} }} }} !! html !! end !! test Test empty array as the second input !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{AF_EMPTY}} }} }} !! html !! end !! test Test both arrays empty !! wikitext {{#af_print: {{#af_difference: {{#af_list: }} | {{#af_list: }} }} }} !! html !! end !! test Test case sensitivity !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | B | c }} | {{#af_list: A | b | C }} }} }} !! html !! end !! test Test duplicate elements in the first array !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | a | b | c }} | {{#af_list: c }} }} }} !! html !! end !! test Test duplicate elements in the second array !! wikitext {{#af_print: {{#af_difference: {{#af_list: a | b | c }} | {{#af_list: c | c | d }} }} }} !! html !! end !! test Test complex nested arrays !! wikitext {{#af_print: {{#af_difference: {{#af_list: {{#af_list: a | b }} | c }} | {{#af_list: b | c }} }} }} !! html !! end !! test Test large arrays !! wikitext {{#af_print: {{#af_difference: {{#af_list: a1 | a2 | a3 | a4 | a5 }} | {{#af_list: a3 | a4 | a5 | a6 | a7 }} }} }} !! html !! end