Jump to content

Module:syl-translit/testcases

From Wiktionary, the free dictionary

This is the unit-testing module for Module:syl-translit.

20 of 23 tests failed. (refresh)

TextExpectedActualDiffers at
test_translit_TONE:
Failedꠊꠣꠝɡámgámo1
Failedꠊꠞgórgór2
Failedꠊꠥꠠꠣgúṛagúṛa2
Failedꠃ’ꠜꠣꠘꠤúbániúbáni1
Failedꠀ’ꠅꠞáoráor1
Failedꠅ’ꠄóeóe1
Failedꠇꠣꠑꠟxaṭólxaṭól4
Failedꠈꠣꠟꠤxálixáli2
Failedꠉꠣꠜꠤꠘgabíngabíno4
Failedꠀꠁꠌ꠆ꠍꠣaiccáaiccá5
Failedꠙꠣꠑꠣfaṭáfaṭá4
Failedꠇꠥꠑꠣkuṭákuṭá4
Failedꠙꠣꠈꠣfaxáfaxá4
TextExpectedActualDiffers at
test_translit_sylheti:
Failedꠀꠘ꠆ꠗꠣꠁꠞandairandáir5
Passedꠉꠣꠠꠤꠀgaṛiagaṛia
Failedꠇꠚꠟxofolxofól5
Failedꠇꠂꠚꠟxoifolxoifól6
Failedꠛꠤꠍ꠆ꠘꠣbisnabiśna4
Failedꠙꠣꠈfaxfaxó4
Failedꠝꠣꠍmasmasó4
Passedꠇꠌꠥꠀxosuaxosua
Failedꠇꠣꠑxaṭxaṭó4
Passedꠌꠇꠞsoxorsoxor

-- 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