Module:Samr-translit/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_samaritan:
Passedࠔࠢࠋࠫࠌšâlomšâlom
Passedࠇࠟࠅ࠘࠙ࠠࠄḥå̂bbåhḥå̂bbåh
Passedࠌࠪࠚࠥࠎࠬࠐࠟࠓࠪࠉmiỹăsfå̂riymiỹăsfå̂riy
Passedࠌࠪࠄࠛࠟࠇࠝࠋࠠࠊmihỹå̂ḥelåkmihỹå̂ḥelåk
Passedࠀࠗࠇࠉࠊʾʿḥykʾʿḥyk
Passedࠇࠖࠣࠉࠠࠄḥʿayåhḥʿayåh
Passedࠄࠠࠨࠍࠬࠔࠝࠌhåinšemhåinšem
Passedࠀࠝࠦࠌࠝࠓʾeumerʾeumer
Passedࠨࠍࠔࠪࠉinšiyinšiy

-- Unit tests for [[Module:Samr-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local Samr_translit = require('Module:Samr-translit')
local m_links = require('Module:links')
local lang = require('Module:languages').getByCode('sam')

--TO DO
function tests:do_test_translit(samr, roman, xlit)
	self:equals(m_links.full_link { lang = lang, term = samr, tr = '-' }, Samr_translit.tr(samr, 'sam', 'Samr'), roman)
end

function tests:test_translit_samaritan()
	local examples = {
		{ 'ࠔࠢࠋࠫࠌ',  'šâlom' },
		{ 'ࠇࠟࠅ࠘࠙ࠠࠄ', 'ḥå̂bbåh' },
		{ 'ࠌࠪࠚࠥࠎࠬࠐࠟࠓࠪࠉ', 'miỹăsfå̂riy' },
		{ 'ࠌࠪࠄࠛࠟࠇࠝࠋࠠࠊ', 'mihỹå̂ḥelåk' },
		{ 'ࠀࠗࠇࠉࠊ', 'ʾʿḥyk' },
		{ 'ࠇࠖࠣࠉࠠࠄ', 'ḥʿayåh' },
		{ 'ࠄࠠࠨࠍࠬࠔࠝࠌ', 'håinšem' },
		{ 'ࠀࠝࠦࠌࠝࠓ', 'ʾeumer' },
		{ 'ࠨࠍࠔࠪࠉ', 'inšiy' },
	}
	self:iterate(examples, 'do_test_translit')
end
 
return tests