Module:Altai-translit/testcases

local tests = require("Module:UnitTests") local transliterate = require("Module:Altai-translit").tr local normalize = mw.ustring.toNFC local gsub = string.gsub

local function tag(text) return ' ' .. text .. ' ' end

local function remove_categories(text) return gsub(text, "%[%[Category:[^%]]+%]%]", "") end

function tests:check(example, expected) self:equals(		tag(example),		remove_categories(normalize(transliterate(example))),		normalize(expected),		{ show_difference = true }	) end

function tests:test_translit local examples = { { "кöндӱрe", "köndüre" }, { "мында", "mında" }, { "кичӱ", "kïčü" }, { "тартыжар", "tartıžar" }, { "сегизинчи", "sägïzïnčï" }, }	tests:iterate(examples, "check") end

return tests