Module:User:AryamanA/hi-IPA/testcases

local tests = require("Module:UnitTests") local m_IPA = require("Module:User:AryamanA/hi-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, "persianized")),		tag_IPA(expected),		{ comment = comment }	) end

function tests:test_all examples = { { "मैं", "mɛ̃ː" }, { "देश", "d̪eːʃ" }, { "मेरा", "meː.ɾɑː"}, { "खिलौना", "kʰɪ.lɔː.nɑː" }, { "नौटंकी", "nɔː.ʈəŋ.kiː" }, { "हौं", "ɦɔ̃ː" }, { "मुँह", "mũːʱ" }, { "माह", "mɑːʱ" }, { "बहना", "bɛʱ.nɑː", "ah pronounced as eh" }, { "विवाह", "ʋɪ.ʋɑːʱ" }, { "ग़म", "ɡəm" }, { "ख़रगोश", "kʰəɾ.ɡoːʃ" }, { "इकट्ठा", "ɪ.kəʈ.ʈʰɑː" }, { "संस्थान", "sən.st̪ʰɑːn" }, { "मधु", "mə.d̪ʱuː", "final u is lengthened, aspiration should not be split in syllabification" }, {"मियाँ", "miː.jɑ̃ː", "i + y lengthens i"}, {"मुहाफ़ज़ाह", "mʊ.ɦɑːf.zɑːʱ"}, {"स्त्रीत्व", "st̪ɾiːt̪ʋ"}, {"शास्त्र", "ʃɑːst̪ɾ"}, {"समाचार", "sə.mɑː.t͡ʃɑːɾ"}, {"श्रावण", "ʃɾɑː.ʋəɳ"}, {"हमें", "ɦə.mẽː"}, {"भैया", "bʱəiː.jɑː"}, {"सुलह", "sʊ.lɛːʱ"}, {"दृष्टि", "d̪ɾɪʃ.ʈiː"}, {"सोई", "soː.iː"}, {"खाइए", "kʰɑː.ɪ.eː"}, {"शक्ति", "ʃək.t̪iː"}, {"उस्ताद", "ʊs.t̪ɑːd̪"}, {"पंकज", "pəŋ.kəd͡ʒ"}, {"माला", "mɑː.lɑː"}, {"दीवार", "diː.ʋɑːɾ"}, {"सुरुची", "sʊ.ɾʊ.t͡ʃiː"}, {"निरस्त्र", "nɪ.ɾəs.t̪ɾə"}, {"निर्वृत्त", "nɪɾ.ʋɾɪt̪t̪"}, {"मृत्युंजय", "mɾɪt̪.jʊɲ.d͡ʒəj"}, {"पितृओं", "pɪt̪.ɾõː"}, {"गर्भ॰पात", "ɡəɾbʱ.pɑːt̪"}, {"गर्भ-पात", "ɡəɾbʱ.pɑːt̪"}, {"गर्भ", "ɡəɾbʱ"}, {"वस्त्र", "ʋəs.t̪ɾᵊ"}, {"यक्ष्मा", "jək.ʂmɑː"}, {"उत्प्रेक्षा", "ʊt̪.pɾeːk.ʂɑː"}, {"झुंझलाहट", "d͡ʒʊɲ.d͡ʒʱlɑː.həʈ"}, {"संख्या", "səŋ.kʰjɑː"}, {"घुँघरू", "ɡʱʊŋ.ɡʱɾuː"}, {"संभ्रांत", "səm.bʱɾɑːnt̪"}, {"इन्फ़्लुएंज़ा", "ɪn.flʊ.eːn.zɑː"}, {"इंफ़्लुएंज़ा", "ɪn.flʊ.eːn.zɑː"} } --	Copy the following to add more examples:		{ "", "" }, tests:iterate(examples, "check_output") end

return tests