Module:kru-Tols-translit/testcases

From Linguifex
Revision as of 12:46, 21 April 2026 by Sware (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

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

function tests:check_translit(Tols, roman, lang)
	lang = lang or 'kru'
	local title = '<span class="Tols" lang="'..lang..
		'">[[' .. Tols .. '#Kurukh|' .. Tols .. ']]</span>'
	if lang ~= 'kru' then title = lang..': '..title end 
	self:equals(title, kru_Tols_translit.tr(Tols, lang, 'Tols'), roman)
end

local examples = {
	{ "𑷊𑶲𑷗𑶲𑷖", "kũṛux" },
	{ "𑷔𑶴𑷎𑷔𑷊𑷐𑶰𑶻", "saṅskrit" },
}

function tests:test_translit_kurukh()
	self:iterate(examples, check_translit)
end
 
return tests