Module:User:AmazingJus/sce/testcases
Appearance
- The following documentation is located at Module:User:AmazingJus/sce/testcases/documentation. [edit] Categories were auto-generated by Module:documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • user page • user talk page • userspace
2 of 9 tests failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
baer | /pɑˈɚ/ | /pɑˈɚ/ | |
tiigha | /tʰɯˈqɑ/ | /tʰɯˈqɑ/ | |
niere | /njəˈrə/ | /njəˈrə/ | |
enzhegve | /ənt͡ʂəˈʁə/ | /ənt͡ʂəˈʁə/ | |
xiaojierun (xiaojieruŋ ) | /ɕjɑwt͡ɕjəˈruŋ/ | /ɕjɑwt͡ɕjəˈruŋ/ | |
ershi ('ershi ) | /ˈɚʂi/ | /ˈɚʂi/ | |
ruhher ('ruhher ) | /ˈʐuhɚ/ | /ˈʐuhɚ/ |
Text | Expected | Actual | |
---|---|---|---|
korolon | [kʰoroˈlõŋ] | [k⁽ʷ⁾or⁽ʷ⁾ol⁽ʷ⁾õn] | |
hotou | [xʷoˈtəu̯~xʷoˈtɤu̯] | [h⁽ʷ⁾otəu̯ ~ h⁽ʷ⁾otɤu̯] |
local tests = require("Module:UnitTests")
local m_IPA = require("Module:User:AmazingJus/sce")
local gsub = mw.ustring.gsub
local sce = require("Module:languages").getByCode("sce")
local function link(text)
return require("Module:links").full_link { term = text, lang = sce }
end
local function respell(term)
local original_term = term
term = gsub(term, "'", ""):gsub("ŋ", "n")
return term, original_term ~= term and term or nil
end
function tests:test_phonemic_IPA()
local testcases = {
{ "baer", "pɑˈɚ" },
{ "tiigha", "tʰɯˈqɑ" },
{ "niere", "njəˈrə" },
{ "enzhegve", "ənt͡ʂəˈʁə" },
{ "xiaojieruŋ", "ɕjɑwt͡ɕjəˈruŋ" },
{ "'ershi", "ˈɚʂi", "zh" },
{ "'ruhher", "ˈʐuhɚ", "zh" }
}
local options = {
display = function(IPA)
return '<span class="IPA">/' .. IPA .. '/</span>'
end
}
self:iterate(testcases, function(self, term, IPA, etyl)
local respelt, is_respelt = respell(term)
if is_respelt then
self:equals(link(respelt) .. " (<code>" .. term .. "</code>)", m_IPA.IPA_m(term, etyl), IPA, options)
else
self:equals(link(term), m_IPA.IPA_m(term, etyl), IPA, options)
end
end)
end
function tests:test_phonetic_IPA()
local testcases = {
{ "korolon", "kʰoroˈlõŋ" },
{ "hotou", "xʷoˈtəu̯~xʷoˈtɤu̯" }
}
local options = {
display = function(IPA)
return '<span class="IPA">[' .. IPA .. ']</span>'
end
}
self:iterate(testcases, function(self, term, IPA, etyl)
local respelt, is_respelt = respell(term)
if is_respelt then
self:equals(link(respelt) .. " (<code>" .. term .. "</code>)", m_IPA.IPA_t(term, etyl), IPA, options)
else
self:equals(link(term), m_IPA.IPA_t(term, etyl), IPA, options)
end
end)
end
return tests