Module:ssy-IPA/testcases
Appearance
- The following documentation is located at Module:ssy-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 7 tests failed. (refresh)
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
dor-ho | dor-ho | dor‧ho | 4 | |
kwanna | kwan‧na | kwan‧na | ||
qiraa-a | qi‧raa-a | qi‧raa‧a | 7 |
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
dor-hö | dorˈho | dorˈho | ||
kwannä | kʷänˈnä | kʷanˈna | 3 | |
qiraa-ä | kʼiräːˈʔä | kʼiraːˈʔa | 5 | |
thüth | ˈtʼutʼ | ˈtʼutʼ |
local tests = require("Module:UnitTests")
local m_IPA = require("Module:ssy-IPA")
local lang = require("Module:languages").getByCode("ssy")
local function tag_IPA(IPA) return '<span class="IPA">' .. IPA .. '</span>' end
local options = {display = tag_IPA}
local function link(word) return require("Module:links").full_link({term = word, lang = lang}, nil, true) end
function tests:check_pron(word, expected)
self:equals(
link(word), m_IPA.pronunciation_phonemic(word), expected, options
)
end
function tests:test_pron()
local examples = {
{"dor-hö", "dorˈho"},
{"kwannä", "kʷänˈnä"},
{"qiraa-ä", "kʼiräːˈʔä"},
{"thüth", "ˈtʼutʼ" },
}
tests:iterate(examples, "check_pron")
end
function tests:test_hyphenation()
local function format_hyphenation(hyphenation)
return table.concat(hyphenation, "‧")
end
self:iterate(
{
{ "dor-ho", { "dor-ho" } },
{ "kwanna", { "kwan", "na" } },
{ "qiraa-a", { "qi", "raa-a" } },
},
function(self, term, expected)
self:equals(
link(term),
format_hyphenation(m_IPA.syllabify(term)),
format_hyphenation(expected)
)
end
)
end
return tests