Module:xal-translit/testcases

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

1 of 3 tests failed. (refresh)

TextExpectedActual
test_translit:
FailedХальмг ТаңһчXal'mg TañhçXalʹmg Tañğç
Passedмөрнmörnmörn
PassedӘрәсәÄräsäÄräsä

local tests = require('Module:UnitTests')
local tr = require('Module:xal-translit').tr

local tag = mw.text.tag
local function tag_Kalmyk(text)
	return tag("span", { class = "Cyrl", lang = "xal" }, text)
end

function tests:check_translit(example, expected)
	self:equals(
		tag_Kalmyk(example),
		tr(example),
		expected)
end

function tests:test_translit()
	local examples = {
		{ "Хальмг Таңһч", "Xal'mg Tañhç" },
		{ "мөрн", "mörn" },
		{ "Әрәсә", "Äräsä" },
	}
	self:iterate(examples, "check_translit")
end

return tests