local myModule = require 'Modul:UploadCampaignLink'
local ScribuntoUnit = require 'Module:ScribuntoUnit'
local suite = ScribuntoUnit:new()
function suite:testNoReplacement()
self:assertEquals('', myModule._fixLinks{ '' })
self:assertEquals('nic k nahrazení', myModule._fixLinks{ 'nic k nahrazení' })
end
function suite:testExpandLink()
self:assertEquals('[[:cs:foo|foo]]', myModule._fixLinks{ '[[foo]]' })
self:assertEquals('[[:cs:foo]]', myModule._fixLinks{ '[[:cs:foo]]' })
self:assertEquals('[[:cs:foo|bar]]', myModule._fixLinks{ '[[foo|bar]]' })
self:assertEquals('[[:cs:foo|bar]]', myModule._fixLinks{ '[[:cs:foo|bar]]' })
end
function suite:testMoreReplacements()
self:assertEquals(
'[[:cs:foo|bar]] nebo [[:cs:baz]]',
myModule._fixLinks{ '[[foo|bar]] nebo [[:cs:baz]]' }
)
end
return suite