Module:qualifier/testcases

local ScribuntoUnit = require('Module:ScribuntoUnit') local suite = ScribuntoUnit:new local m_qualifier = require('Module:qualifier')

function suite:test_format_qualifier_no_arguments local result = m_qualifier.format_qualifier({}) suite:assertEquals('', result) end

function suite:test_format_qualifier_single_argument local result = m_qualifier.format_qualifier({'foo'}) suite:assertEquals(' ( foo ) ', result) end

function suite:test_format_qualifier_multiple_arguments local result = m_qualifier.format_qualifier({'foo', 'bar'}) suite:assertEquals(' ( foo, bar ) ', result) end

function suite:test_qualifier_t local frame = mw.getCurrentFrame:newChild({ title = 'test', args = { 'foo' } }):newChild{} local result = m_qualifier.qualifier_t(frame) suite:assertEquals(' ( foo ) ', result) end

function suite:test_sense_t local frame = mw.getCurrentFrame:newChild({ title = 'test', args = { 'foo' } }):newChild{} local result = m_qualifier.sense_t(frame) suite:assertEquals(' ( foo ) : ', result) end

return suite