Module:User:ND381/shanghainese-test/testcases

local tests = require("Module:UnitTests")

local m_pron = require("Module:wuu-pron")

local function code(text) return ' ' end

local function link(text) return ' ' .. text .. ' ' end

local function tag_IPA (IPA) return ' ' .. IPA .. ' ' 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[funcName] 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