Module:yo-pron/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

All tests passed. (refresh)

TextExpectedActual
test_pron:
PassedAdébáyọ̀ā.dé.bá.jɔ̀ā.dé.bá.jɔ̀
Passedẹẹ́sàn-ándínláàádọ́sàn-ánɛ̄ɛ́.sã̀ã́.dĩ́.láàá.dɔ́.sã̀ã́ɛ̄ɛ́.sã̀ã́.dĩ́.láàá.dɔ́.sã̀ã́
PassedẸ káàárọ̀ɛ̄ káàá.ɾɔ̀ɛ̄ káàá.ɾɔ̀
Passed
Passedkọ̀m̀pútàkɔ̀.ŋ̀.k͡pú.tàkɔ̀.ŋ̀.k͡pú.tà
Passednàánã̀ã́nã̀ã́
Passedoghóō.ɣóō.ɣó
Passedsẹngwàsɛ̃̄.ɡʷàsɛ̃̄.ɡʷà
Passedụ̀ṣàʊ̀.ʃàʊ̀.ʃà
Passedị̀kàràɪ̀.kà.ɾàɪ̀.kà.ɾà
Passedn̄ǹkanŋ̄ŋ̀.kã̄ŋ̄ŋ̀.kã̄
PassedṢáínàʃá.í.nàʃá.í.nà
PassedYorùbájō.ɾù.bájō.ɾù.bá
Passedmárùn-únmá.ɾũ̀ṹmá.ɾũ̀ṹ
Passedẹ̀ẹ́dẹ́gbẹ̀rùn-ún lọ́náɛ̀ɛ́.dɛ́.ɡ͡bɛ̀.ɾũ̀ṹ lɔ́.nã́ɛ̀ɛ́.dɛ́.ɡ͡bɛ̀.ɾũ̀ṹ lɔ́.nã́
Passedlálálá.lálá.lá
Passedlálálá.ꜜlálá.ꜜlá

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 '<span class="IPA">' .. IPA .. '</span>' 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