Module:pam-pron/testcases

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

All tests passed. (refresh)

TextExpectedActual
test_phonetic_pron:
Passedaldoəlˈdoːəlˈdoː
Passedamanuəˈmäː.nuəˈmäː.nu
Passedbalebəˈlɛːbəˈlɛː
Passedbakaˈbäː.xəˈbäː.xə
Passedbatuinbəˈtwinbəˈtwin
Passedkamaruˈkäː.mə.ɾuˈkäː.mə.ɾu
Passeddeniˈdɛː.niˈdɛː.ni
PassedWawaˈwäː.wəʔˈwäː.wəʔ

local tests = require("Module:UnitTests")
local m_pam_pron = require("Module:pam-pron")

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

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

function tests:test_phonetic_pron()
	local examples = {
        { "aldo","əlˈdoː","aldó" },
        { "amanu","əˈmäː.nu","amánu" },
        { "bale","bəˈlɛː", "balé" },
        { "baka","ˈbäː.xə","báka" },
        { "batuin","bəˈtwin", "batuin" },
        { "kamaru","ˈkäː.mə.ɾu", "kámaru" },
        { "deni","ˈdɛː.ni", "déni" },
        { "Wawa", "ˈwäː.wəʔ", "Wáwâ"}
	}
	self:iterate(examples, "check_phonetic_ipa")
end


return tests