Module:sk-IPA/testcases
Jump to navigation
Jump to search
- The following documentation is located at Module:sk-IPA/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 14 tests failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
mäso | ˈmɛɐ̯sɔ | ˈmɛɐ̯sɔ | |
ďakovať | ˈɟakɔvac | ˈɟakɔvac | |
chlieb | xʎi̯ep | xʎi̯ep | |
štvrť | ʃtvr̩c | ʃtvr̩c | |
vĺča | ˈvl̩ːt͡ʃa | ˈvl̩ːt͡ʃa | |
vŕba | ˈvr̩ːba | ˈvr̩ːba | |
kôň | ku̯oɲ | ku̯oɲ | |
čln | t͡ʃl̩n | t͡ʃln | |
šmrnc | ʃmr̩nt͡s | ʃmrn̩t͡s | |
detstvo | ˈɟet͡stvɔ | ˈɟetstvɔ | |
leto | ˈʎetɔ | ˈʎetɔ | |
nebo | ˈɲebɔ | ˈɲebɔ | |
deti | ˈɟeci | ˈɟeci | |
dabing | ˈdabiŋk | ˈdabink |
local tests = require('Module:UnitTests')
local m_IPA = require('Module:sk-IPA')
local m_links = require("Module:links")
local lang = require("Module:languages").getByCode("sk")
local sc = require("Module:scripts").getByCode("Latn")
local function tag_IPA(IPA)
return '<span class="IPA">' .. IPA .. '</span>'
end
function tests:check_output(term, expected)
tests:equals(
m_links.full_link({ term = term, lang = lang, sc = sc } ),
m_IPA.toIPA(term),
expected,
{ display = tag_IPA }
)
end
function tests:test_all()
local examples = {
{ "mäso", "ˈmɛɐ̯sɔ" },
{ "ďakovať", "ˈɟakɔvac" },
{ "chlieb", "xʎi̯ep" },
{ "štvrť", "ʃtvr̩c" },
{ "vĺča", "ˈvl̩ːt͡ʃa" },
{ "vŕba", "ˈvr̩ːba" },
{ "kôň", "ku̯oɲ" },
{ "čln", "t͡ʃl̩n" },
{ "šmrnc", "ʃmr̩nt͡s" },
-- palatalisation is expected for d, t, n and l before e and i (there are exceptions to be respelled)
{ "detstvo", "ˈɟet͡stvɔ" },
{ "leto", "ˈʎetɔ" },
{ "nebo", "ˈɲebɔ" },
{ "deti", "ˈɟeci" },
-- n should become ŋ before k and g
{ "dabing", "ˈdabiŋk" },
}
self:iterate(examples, "check_output")
--[[ additions take this form:
{ "", "" },
]]
end
return tests