Module:Cyrs-translit/testcases
Appearance
- The following documentation is located at Module:Cyrs-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
This is the unit-testing module for Module:Cyrs-translit.
All tests passed. (refresh)
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
оу | u | u | ||
сꙑнъ | synŭ | synŭ | ||
ѣхати | ěxati | ěxati | ||
бѣлъ | bělŭ | bělŭ | ||
-ъѣ- | -ŭě- | -ŭě- | ||
аѵ | av | av | ||
щенѧ | štenę | štenę | ||
четꙑре | četyre | četyre | ||
заѧць | zaęcĭ | zaęcĭ |
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
оу | u | u | ||
стръи | strŷi | strŷi | ||
ѣхати | jěxati | jěxati | ||
бѣлъ | bělŭ | bělŭ | ||
-ъѣ- | -ŭjě- | -ŭjě- | ||
аѵ | av | av | ||
щенѧ | śćenę | śćenę | ||
четꙑре | ćetyre | ćetyre | ||
ꙁаѧць | zajęćĭ | zajęćĭ |
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
оу | u | u | ||
стръи | strŷi | strŷi | ||
ѣхати | jěxati | jěxati | ||
бѣле | běle | běle | ||
-ъѣ- | -ŭjě- | -ŭjě- | ||
аѵ | av | av | ||
щенѧ | ščenę | ščenę | ||
четꙑре | četyre | četyre | ||
заѧць | zajęcĭ | zajęcĭ |
local tests = require('Module:UnitTests')
local m_tr = require('Module:Cyrs-translit')
local full_link = require('Module:links').full_link
local lang_cu = require('Module:languages').getByCode('cu')
local lang_ono = require('Module:languages').getByCode('zle-ono')
local lang_orv = require('Module:languages').getByCode('orv')
local function link(word, lang)
return full_link{ term = word, lang = lang, tr = "-" }
end
function tests:do_test_translit_cu(word, tr)
self:equals(link(word, lang_cu), m_tr.tr(word, "cu"), tr)
end
function tests:do_test_translit_ono(word, tr)
self:equals(link(word, lang_ono), m_tr.tr(word, "zle-ono"), tr)
end
function tests:do_test_translit_orv(word, tr)
self:equals(link(word, lang_orv), m_tr.tr(word, "orv"), tr)
end
function tests:test_translit_cu()
local examples = {
{ "оу", "u" },
{ "сꙑнъ", "synŭ" },
{ "ѣхати", "ěxati" },
{ "бѣлъ", "bělŭ" },
{ "-ъѣ-", "-ŭě-" },
{ "аѵ", "av" },
{ "щенѧ", "štenę" },
{ "четꙑре", "četyre" },
{ "заѧць", "zaęcĭ" },
}
self:iterate(examples, "do_test_translit_cu")
end
function tests:test_translit_ono()
local examples = {
{ "оу", "u" },
{ "стръи", "strŷi" },
{ "ѣхати", "jěxati" },
{ "бѣлъ", "bělŭ" },
{ "-ъѣ-", "-ŭjě-" },
{ "аѵ", "av" },
{ "щенѧ", "śćenę" },
{ "четꙑре", "ćetyre" },
{ "ꙁаѧць", "zajęćĭ" },
}
self:iterate(examples, "do_test_translit_ono")
end
function tests:test_translit_orv()
local examples = {
{ "оу", "u" },
{ "стръи", "strŷi" },
{ "ѣхати", "jěxati" },
{ "бѣле", "běle" },
{ "-ъѣ-", "-ŭjě-" },
{ "аѵ", "av" },
{ "щенѧ", "ščenę" },
{ "четꙑре", "četyre" },
{ "заѧць", "zajęcĭ" },
}
self:iterate(examples, "do_test_translit_orv")
end
return tests