1 of 0 tests failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
Script error during testing: Module:wuu-pron/testcases:23: No function called "ipa_conv" in Module:wuu-pron.stack traceback: : ? : in function 'error' Module:wuu-pron/testcases:23: in function 'check' Module:wuu-pron/testcases:34: in function <Module:wuu-pron/testcases:29> (tail call): ? (tail call): ? : in function 'xpcall' Module:fun/xpcall:37: in function 'xpcall' Module:UnitTests:389: in function <Module:UnitTests:350> (tail call): ? mw.lua:527: in function <mw.lua:507> : ? : in function 'expandTemplate' mw.lua:333: in function <mw.lua:307> (tail call): ? (tail call): ? Module:documentation:1043: in function 'chunk' mw.lua:527: in function <mw.lua:507> : ? |
local tests = require("Module:UnitTests")
local m_pron = require("Module:wuu-pron")
local function code(text)
return '<code>' .. text .. '</code>'
end
local function link(text)
return '<span class="Hani" lang="zh">]</span>'
end
local function tag_IPA (IPA)
return '<span class="IPA">' .. IPA .. '</span>'
end
local function show(wuu, zh)
return code(wuu) .. " (" .. link(zh) .. ")"
end
local options = { display = tag_IPA }
function tests:check(funcName)
local func = m_pron or error('No function called "' .. funcName .. '" in Module:wuu-pron.')
return function (self, example, entry, actual)
self:equals(show(example, entry), func(example), actual, options)
end
end
function tests:test_IPA_conv()
local examples = {
{ "2'ieu zu hhyoe", "幼稚園", "ʔiɜ³³ z̻v̩ʷ⁵⁵ ɦyø²¹" }, -- 幼稚園
{ "1tson hho", "中華", "t͡sʊŋ⁵⁵ ɦo²¹" },
}
self:iterate(examples, self:check("ipa_conv"))
end
return tests