Module:lep-translit/testcases

From Linguifex
Jump to navigation Jump to search

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

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

function tests:do_test_translit(lepc, roman, xlit)
	self:equals('<span class="Lepc" lang="lep">[[' .. mw.ustring.gsub(lepc, "%+", "") .. '#Lepcha|' .. mw.ustring.gsub(lepc, "%+", "") .. ']]</span>', lep_translit.tr(lepc, 'lep', 'Lepc'), roman)
end

function tests:test_translit_lepcha()
	self:do_test_translit('ᰕᰧ', 'mi')
	self:do_test_translit('ᰈᰬᰲ', 'jer')
	self:do_test_translit('ᰎᰪᰰᰈᰬᰵ', 'punjeng')
	self:do_test_translit('ᰀᰁᰂᰃᰄᰅ','kaklakhagaglanga')
	self:do_test_translit('ᰆᰇᰈᰉ','cachajanya')
	self:do_test_translit('ᰊᰋᰌᰍ','tathadana')
	self:do_test_translit('ᰎᰏᰐᰑᰒᰓᰔᰕᰖ','paplaphafaflabablamamla')
	self:do_test_translit('ᰗᰘᰙ','tsatshadza')
	self:do_test_translit('ᰚᰛᰜᰝᰞᰟᰠᰡᰢᰣ','yaralahahlavasashawaʔa')
	self:do_test_translit('ᱍᱎᱏ', 'ttatthadda')
	self:do_test_translit('ᰜᰜᰶᰜᰦᰜᰧᰜᰧᰶᰜᰨᰜᰩᰜᰪᰜᰫᰜᰬ', 'lalâlálilílolólulúle')
	self:do_test_translit('ᰜᰭᰜᰮᰜᰯᰜᰰᰜᰱᰜᰲᰜᰳᰜᰫᰴᰜᰫᰵ', 'laklamlallanlaplarlatlúnglúng')
	self:do_test_translit('ᰣᰣᰶᰣᰦᰣᰧᰣᰧᰶᰣᰨᰣᰩᰣᰪᰣᰫᰣᰬ', 'ʔaʔâʔáʔiʔíʔoʔóʔuʔúʔe')
	self:do_test_translit('᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉', '0123456789')
	self:do_test_translit('ᰜᰤᰜᰥ', 'lyalra')
	self:do_test_translit('ᰀᰪᰕᰨ', 'kumo')
	self:do_test_translit('ᰀᰩᰰ', 'kón')
	self:do_test_translit('ᰌᰧᰶ', 'dí')
	self:do_test_translit('ᰋᰩᰭ', 'thók')
	self:do_test_translit('ᰁᰩᰱ', 'klóp')
	self:do_test_translit('ᰕᰩ', 'mó')
	self:do_test_translit('ᰀᰥᰫᰳ', 'krút')
	self:do_test_translit('ᰍᰩᰵ', 'nóng')
	self:do_test_translit('ᰜᰩᰵ', 'lóng')
	self:do_test_translit('ᰋᰤᰨᰲ', 'thyor')
	self:do_test_translit('ᰜᰤᰩᰭ', 'lyók')
	self:do_test_translit('ᰊᰰ', 'tan')
	self:do_test_translit('ᰣᰦᰕᰧᰭᰶ', 'ʔámík')
end

return tests