Jump to content

Module:Lang-hbs/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Czarkoff (talk | contribs) at 10:43, 16 June 2014 (Added another testcase (for non-Cyrillic input), updated expected results per recent change in template). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Example Unit tests for [[Module:Bananas]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_convert()
    self:preprocess_equals('{{#invoke:hbs-cyr2lat|convert|text=Краљевина Југославија}}', "''Kraljevina Jugoslavija''")
end

function p:test_concat_simple()
    self:preprocess_equals('{{#invoke:hbs-cyr2lat|concat|text=Краљевина Југославија}}', "Краљевина Југославија, ''Kraljevina Jugoslavija''")
end

function p:test_concat_full()
    self:preprocess_equals('{{#invoke:hbs-cyr2lat|concat|text=Краљевина Југославија| or |swap=yes}}', "''Kraljevina Jugoslavija'' or Краљевина Југославија")
end

function p:test_concat_latin()
    self:preprocess_equals('{{#invoke:hbs-cyr2lat|concat|text=Kraljevina Jugoslavija}}', "''Kraljevina Jugoslavija''")
end

return p