Module:syl-translit/testcases
Documentation for this module may be created at Module:syl-translit/testcases/doc
-- Unit tests for [[Module:syl-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local syl_translit = require('Module:syl-translit')
local lang = require('Module:languages').getByCode('syl')
local m_links = require('Module:links')
local function link(term)
return m_links.full_link { lang = lang, term = term, tr = '-' }
end
function tests:do_test_translit(sylo, roman, xlit)
self:equals(link(sylo), syl_translit.tr(sylo, 'syl', 'Sylo'), roman)
end
function tests:test_translit_sylheti()
self:do_test_translit('ꠀꠘ꠆ꠗꠣꠁꠞ', 'andair')
self:do_test_translit('ꠉꠣꠠꠤꠀ', 'gaṛia')
self:do_test_translit('ꠇꠚꠟ', 'xofol')
self:do_test_translit('ꠇꠂꠚꠟ', 'xoifol')
self:do_test_translit('ꠛꠤꠍ꠆ꠘꠣ', 'bisna')
self:do_test_translit('ꠙꠣꠈ', 'fax')
self:do_test_translit('ꠝꠣꠍ', 'mas')
self:do_test_translit('ꠇꠌꠥꠀ', 'xosua')
self:do_test_translit('ꠇꠣꠑ', 'xaṭ')
self:do_test_translit('ꠌꠇꠞ', 'soxor')
end
function tests:test_translit_TONE()
self:do_test_translit('ꠊꠣꠝ', 'ɡám')
self:do_test_translit('ꠊꠞ', 'gór')
self:do_test_translit('ꠊꠥꠠꠣ', 'gúṛa')
self:do_test_translit('ꠃ’ꠜꠣꠘꠤ', 'úbáni')
self:do_test_translit('ꠀ’ꠅꠞ', 'áor')
self:do_test_translit('ꠅ’ꠄ', 'óe')
self:do_test_translit('ꠇꠣꠑꠟ', 'xaṭól')
self:do_test_translit('ꠈꠣꠟꠤ', 'xáli')
self:do_test_translit('ꠉꠣꠜꠤꠘ', 'gabín')
self:do_test_translit('ꠀꠁꠌ꠆ꠍꠣ', 'aiccá')
self:do_test_translit('ꠙꠣꠑꠣ', 'faṭá')
self:do_test_translit('ꠇꠥꠑꠣ', 'kuṭá')
self:do_test_translit('ꠙꠣꠈꠣ', 'faxá')
end
return tests