Module:User:AmazingJus/sco/testcases

local tests = require("Module:UnitTests") local ipa = require("Module:User:AmazingJus/sco")

local function tag_IPA(IPA) return ' ' .. IPA .. ' ' end

function tests:check_IPA(term, func, expected, comment) self:equals(		ipa.link(term),		tag_IPA(mw.ustring.toNFC(func(term))),		tag_IPA(expected),		{ comment = comment, show_difference = true }	) end

function tests:test_pron local examples = { { "stane", "ˈsten", "" }, { "yowe", "ˈsten", "ˈjʌʉː" }, { "thousand", "ˈsten", "ˈhʉːzən" }, { "traivel", "ˈsten", "ˈtreːvəl" }, { "efternuin", "ˈsten", "ˌɛftərˈnøn" } }	--	Copy the following to add more examples:		{ "", "", "" },

for _, example in ipairs(examples) do		local term, expected, comment = unpack(example) self:check_IPA(term, ipa.toIPA, expected, comment) end end

return tests