Module:kip-IPA/testcases

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

local function tag_IPA(IPA) if phonetic then IPA = '/' .. IPA .. '/'		else IPA = '[' .. IPA .. ']'		end return ' ' .. IPA .. ' ' end function tests:check_output(term, expected, comment) self:equals(		m_IPA.link(term),		tag_IPA(m_IPA.toIPA(term, "standard")),		tag_IPA(expected),		{ comment = comment }	) end

function tests:test_phonetic examples = { { "ज़ा", "zɐ" }, { "झङ", "d͡zə̤ŋ" }, { "झ़ार", "zɐ̤r" }, { "व़ाः", "ɥɐ̤" }, { "ह्व़े", "ɥ̊e" }, { "ह्लेपा", "ɬe.pɐ" }, { "बोङ्दै", "boŋ.dəj" }, { "कलिःङ्गा", "kə.li̤ŋ.ɡɐ" }, { "चोः", "t͡so̤" }, } tests:iterate(examples, "check_output")

end

return tests