Module:Altai-translit/testcases
Appearance
- The following documentation is located at Module:Altai-translit/testcases/documentation. [edit] Categories were auto-generated by Module:module categorization. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox
4 of 5 tests failed. (refresh)
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
кöндӱрe | köndüre | köndüre | ||
мында | mında | mïnda | 2 | |
кичӱ | kïčü | kičü | 2 | |
тартыжар | tartıžar | tartïžar | 5 | |
сегизинчи | sägïzïnčï | segizinči | 2 |
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 '<span class="Cyrl">' .. text .. '</span>'
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