Module:mni-translit/testcases

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

-- Unit tests for [[Module:mni-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local bn_translit = require('Module:mni-translit')

local function link(word)
	return '<span class="Mtei" lang="mni">[[' .. word .. '#Manipuri|' .. word .. ']]</span>'
end

function tests:do_test_translit(mtei, roman, xlit)
	return self:equals(link(mtei), mni_translit.tr(mtei, 'mni', 'Mtei', 'debug'), roman)
end

function tests:test_translit_manipuri()
	local examples = {
		{ 'ꯃꯩꯇꯩ', 'meitei' },
		{ 'ꯃꯅꯤꯄꯨꯔ', 'monipur' },
	}
	self:iterate(examples, "do_test_translit")
end
 
return tests