Module:yo-pron/testcases

local tests = require("Module:UnitTests") local m_IPA = require("Module:yo-pron") local lang = require("Module:languages").getByCode("yo")

local function tag_IPA(IPA) return ' ' .. IPA .. ' ' end local options = {display = tag_IPA}

function tests:check_pron(word, expected, loan, downstep) self:equals(		require("Module:links").full_link({term = word, lang = lang}, nil, true), m_IPA.IPA(word, loan, downstep), expected, options	) end

function tests:test_pron local examples = { {"Adébáyọ̀", "ā.dé.bá.jɔ̀" }, {"ẹẹ́sàn-ándínláàádọ́sàn-án", "ɛ̄ɛ́.sã̀ã́.dĩ́.láàá.dɔ́.sã̀ã́"}, {"Ẹ káàárọ̀", "ɛ̄ káàá.ɾɔ̀"}, {"kò", "kò" }, {"kọ̀m̀pútà", "kɔ̀.ŋ̀.k͡pú.tà"}, {"nàá", "nã̀ã́"}, {"oghó", "ō.ɣó"}, {"sẹngwà", "sɛ̃̄.ɡʷà"}, {"ụ̀ṣà", "ʊ̀.ʃà"}, {"ị̀kàrà", "ɪ̀.kà.ɾà"}, {"n̄ǹkan", "ŋ̄ŋ̀.kã̄"}, {"Ṣáínà", "ʃá.í.nà", "1"}, {"Yorùbá", "jō.ɾù.bá" }, {"márùn-ún", "má.ɾũ̀ṹ"}, {"ẹ̀ẹ́dẹ́gbẹ̀rùn-ún lọ́ná", "ɛ̀ɛ́.dɛ́.ɡ͡bɛ̀.ɾũ̀ṹ lɔ́.nã́"}, {"lálá", "lá.lá"}, {"lálá", "lá.ꜜlá", "0", "2"} }

tests:iterate(examples, "check_pron") end

return tests