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