Module:Mong-translit/testcases

From Linguifex
Jump to navigation Jump to search

Documentation for this module may be created at Module:Mong-translit/testcases/doc

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

--TO DO
function tests:do_test_translit(mong, roman, xlit)
	self:equals('<span class="Mong" lang="mon">[[' .. mong .. '#Mong|' .. mong .. ']]</span>', mong_translit.tr(mong, 'mon', 'Mong'), roman)
end

function tests:test_translit_mong()
	local examples = {
		{ 'ᠭᠼ', 'gc' },
		{ 'ᠭᠱᠠᠨ', 'gšan' },
		{ 'ᠭᠬᠢᠷ', 'gkir' },
		{ 'ᡀᠠᠭᠪᠠ', 'lhaɣba'},
		{ 'ᠥᠭᠭᠦᠭᠰᠡᠨ', 'öggügsen' },
		{ 'ᠴᠠᠭ', 'čaɣ' },
		{ 'ᠴᠡᠭ', 'čeg' },
		{ 'ᠢᠭ', 'ig' },
		{ 'ᠪᠠᠭ᠎ᠠ', 'baɣ-a' },
		{ 'ᠵᠠᠷᠯᠢᠭ', 'ǰarliɣ' },
		{ 'ᠴᠡᠷᠢᠭ', 'čerig' },
	}
	self:iterate(examples, 'do_test_translit')
end
 
return tests