Jump to content

Module:pag-pron/sandbox/testcases

From Wiktionary, the free dictionary

10 of 11 tests failed. (refresh)

TextExpectedActual
test_phonetic_pron:
Failedagewaˈgɨʊ̯a.ɡɨ́ʊ
Failedbaleybaˈlɨba.lɨ́ɪ
Failedbituenbɪˈtwɨnbɪ.twɨ́n
FailedCamilingka.mɪˈlɪŋka.mɪ.lɪ́ŋ
FailedCariñokaˈɾɪ.njoka.ɾɪ.njo
PassedDiosd͡ʒʊsd͡ʒʊs
FailedEstados Unidosɪsˈta.dʊs ʊˈni.dʊsɪs.ta.dʊs ʊ.nɪ.dʊs
Failedinomiˈnʊmɪ.nʊ́m
Failedsaysaɪ̯saŷ
Failedwawakwaˈwakwa.wák
Failedyabyabjabˈjabjab.jáb

local tests = require("Module:UnitTests")
local m_pag_pron = require("Module:pag-pron/sandbox")

local function pag_IPA(IPA)
	return "<span class='IPA'>" .. IPA .. "</span>"
end

function tests:check_phonetic_ipa(word, expected, respelling)
	self:equals(
		"[[" .. word .. "#Pangasinan|" .. word .. "]]",
		m_pag_pron.IPA(respelling, true),
		expected,
		{ display = tag_IPA }
	)
end

function tests:test_phonetic_pron()
	local examples = {

        { "agew","aˈgɨʊ̯","agë́w" },
        { "baley","baˈlɨ", "balë́y" },
        { "bituen","bɪˈtwɨn", "bituë́n" },
        { "Camiling","ka.mɪˈlɪŋ", "Camilíng" },
        { "Cariño","kaˈɾɪ.njo", "Cariño" },
        { "Dios","d͡ʒʊs", "Dios" },
        { "Estados Unidos","ɪsˈta.dʊs ʊˈni.dʊs", "estados unidos" },
        { "inom","iˈnʊm", "inóm"},
        { "say","saɪ̯", "say"},
		{ "wawak","waˈwak", "wawák"},
		{ "yabyab", "jabˈjab", "yabyáb"},
	}
	self:iterate(examples, "check_phonetic_ipa")
end

return tests