Module:as-IPA/testcases

local tests = require("Module:UnitTests") local m_IPA = require("Module:as-IPA")

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

function tests:check_output(term, expected, comment) self:equals(		m_IPA.link(term),		tag_IPA(m_IPA.toIPA(term)),		tag_IPA(expected),		{ comment = comment }	) end

function tests:test_all examples = { { "মই", "mɔɪ" }, { "দেশ", "dɛx" }, { "মোৰ", "mʊɹ"}, { "শক্তি", "xɔk.ti" }, { "ঔষধ", "oʊ.xɔdʱ" }, { "পৰিয়াল", "po.ɹial" }, { "সোঁফালে", "xʊ̃.pʰa.lɛ" }, { "স্পৰ্শ", "spɔɹ.xɔ" }, { "নাঙল", "na.ŋɔl"}, { "হিংসা", "ɦiŋ.xa" }, { "ঐতিহাসিক", "oɪ.ti.ɦa.xik" }, { "শহা পহু", "xɔ.ɦa po.ɦu" }, { "সম্পূৰ্ণ", "xɔm.puɹ.nɔ" }, { "মগজু", "mo.ɡo.zu" }, { "বিৱৰণ", "bi.wɔ.ɹɔn"}, {"ৰাজ্য", "ɹaɪd.ʑɔ"}, {"জ্বৰ", "zɔɹ"}, {"অধিকাৰ", "o.dʱi.kaɹ"}, {"থকা", "tʰɔ.ka"}, {"খেল", "kʰɛl"}, {"মানুহ", "ma.nuʱ"},

} --	Copy the following to add more examples:		{ "", "" }, tests:iterate(examples, "check_output") end

return tests