Module:User:Jberkel/usex/templates/testcases

local ScribuntoUnit = require('Module:ScribuntoUnit') local m_usex_templates = require('Module:User:Jberkel/usex/templates') local suite = ScribuntoUnit:new

function usex_t(args) local frame = mw.getCurrentFrame:newChild{ title = 'test', args = args } return m_usex_templates.usex_t(frame:newChild{}) end

function usex_t_quote(args) local frame = mw.getCurrentFrame:newChild{ title = 'test', args = args } return m_usex_templates.usex_t(frame:newChild{ args = { quote = '1' } }) end

function suite:test_usex_t_example local result = usex_t { 'fr', 'Ceci est un exemple', 'This is an example' } suite:assertEquals(' Ceci est un exemple&lrm;  This is an example  ', result) end

function suite:test_usex_t_quote local result = usex_t_quote { 'fr', 'Ceci est un quote', 'This is a quotation' } suite:assertEquals(' Ceci est un quote &lrm;  This is a quotation  ', result) end

return suite