Module:hil-pron/testcases

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

All tests passed. (refresh)

TextExpectedActual
test_phonetic_pron:
Passedaksiyonʔakˈsjonʔakˈsjon
Passedalambreʔaˈlam.bɾeʔaˈlam.bɾe
Passedaslumˈʔas.lumˈʔas.lum
Passedbaboyˈba.boɪ̯ˈba.boɪ̯
Passedbukidˈbu.kidˈbu.kid
Passedbulanˈbu.lanˈbu.lan
Passeddyaketˈdja.ketˈdja.ket
Passedkongresokʊŋˈɡɾe.sokʊŋˈɡɾe.so
Passedtawoˈta.woˈta.wo
Passedtsekeˈtse.keˈtse.ke
Passedtuoˈtu.ʔoˈtu.ʔo

local tests = require("Module:UnitTests")
local m_hil_pron = require("Module:hil-pron")

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

local options = { display = tag_IPA }

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

function tests:test_phonetic_pron()
	local examples = {
		{ "aksiyon","ʔakˈsjon", "aksiyón" },
        { "alambre", "ʔaˈlam.bɾe", "alambre" },
        { "aslum", "ˈʔas.lum", "aslum" },

        { "baboy", "ˈba.boɪ̯", "baboy" },
        { "bukid", "ˈbu.kid", "bukid" },
        { "bulan", "ˈbu.lan", "bulan" },
        { "dyaket", "ˈdja.ket", "dyaket" },
        { "kongreso", "kʊŋˈɡɾe.so", "konggreso"},
        { "tawo", "ˈta.wo", "tawo" },
        { "tseke", "ˈtse.ke", "tseke" },
        { "tuo", "ˈtu.ʔo", "tu7o" },
	}
	self:iterate(examples, "check_phonetic_ipa")
end

return tests