Module:Suppress categories/testcases
Appearance
![]() | This is the test cases page for the module Module:Suppress categories. Results of the test cases. |
-- Unit tests for [[Module:Suppress categories]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_main()
self:preprocess_equals_many('{{#invoke:Suppress categories|main|', '}}', {
{'foo', 'foo'},
{'foo[[Category:Some category]]', 'foo'},
{'foo[[Category:Some category]]bar[[Category:Another category]]', 'foobar'},
{'foo{{{some_parameter|[[Category:Bar]]}}}', 'foo'},
{'foo[[Category:Bad ca[]tegory link]]', 'foo[[Category:Bad ca[]tegory link]]'},
{'foo[[:Category:Colon trick]]', 'foo[[:Category:Colon trick]]'},
{'foo[[Category:Piped link|bar]]', 'foo'},
{'foo[[Category:Piped link|ba[]r]]', 'foo'},
{'foo[[non-category link]]', 'foo[[non-category link]]'},
{'foo[[ Category : Some category with spaces ]]', 'foo'}
})
end
return p