Module:lif-IPA/testcases

local tests = require("Module:UnitTests") local m_IPA = require("Module:lif-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 = { { "ᤏᤡᤱᤄᤢᤶ", "niŋ.ɡʱum" }, { "ᤕᤠᤰᤌᤢᤱ", "jak.tʰuŋ" }, { "ᤐᤠᤴ", "pan" }, { "ᤁ᤺ᤰ", "kɔːk" }, { "ᤁᤁ᤻", "kɔːk" }, { "ᤁ᥄᥅॥", "kɔ!? " }, { "ᤁᤴ", "kɔn" }, { "ᤔᤩᤠᤱ", "mjaŋ" }, { "ᤁᤧᤖᤧᤀᤠᤱ", "kɛ.rɛ.ʔaŋ" }, { "ᤌᤡᤰᤁᤥ", "tʰik.koˑ" }, { "ᤏᤠ᤺ᤵᤔᤠ", "naːp.ma" }, } tests:iterate(examples, "check_output")

end

return tests