Module:niv-translit/testcases

Revision as of 12:44, 21 April 2026 by Sware (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local tests = require("Module:UnitTests")
local translit = require("Module:niv-translit")

function tests:check_translit(Cyrl, Latn)
	self:equals(('<span lang="niv" class="Cyrl mention">[[%s#Nivkh|%s]]</span>'):format(Cyrl, Cyrl), translit.tr(Cyrl, 'niv', 'Cyrl'), Latn)
end

function tests:test_translit()
	local examples = {
		{ "ераӄ",  "jeraq" },
		{ "маёдь", "majod̦" },
		{ "поезд", "pojezd" },
		{ "няӽ", "ņaẋ" },
		{ "няӻр", "ņaꜧ̇r" },
		{ "атьх", "ațx" },
		{ "кʼеӄ", "kʼeq" },
		{ "иф урладьғугирпарк ескидь", "if urlad̦ꜧugirpark jeskid̦" },
		{ "нюдь", "ņud̦" },
		{ "ӿилх", "hilx" },
	}
	
	self:iterate(examples, "check_translit")
	
end

return tests