Module:Separated entries/testcases

From MOASSpedia
Jump to navigation Jump to search

Documentation for this module may be created at Module:Separated entries/testcases/doc

-- Unit tests for [[Module:Separated entries]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_main()
    self:preprocess_equals_many('{{#invoke:Separated entries|main|', '}}', {
    	{'', ''},
        {'A', 'A'},
        {'A|B', 'AB'},
        {'A||B', 'AB'}, -- empty parameter
        {'A|B|C', 'ABC'},
        {'separator=,', ''},
        {'separator=,|A', 'A'},
        {'separator=,|A|B', 'A,B'},
        {'separator=,|A||B', 'A,B'}, -- empty parameter
        {'conjunction=;', ''},
        {'conjunction=;|A', 'A'},
        {'conjunction=;|A|B', 'A;B'},
        {'separator=,|conjunction=;', ''},
        {'separator=,|conjunction=;|A', 'A'},
        {'separator=,|conjunction=;|A|B', 'A;B'},
        {'separator=,|conjunction=;|A|B|C', 'A,B;C'},
        {'separator=,|conjunction=;|A|B|C|D', 'A,B,C;D'},
        {'start=2|separator=,|conjunction=;|A|B|C|D', 'B,C;D'},
    })
end

return p