Module:ceb-pron/testcases

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

All tests passed. (refresh)

TextExpectedActual
test_phonetic_pron:
Passedaksiyonʔɐkˈs̪jon̪ʔɐkˈs̪jon̪
Passedalambreʔɐˈl̪am.bɾ̪eʔɐˈl̪am.bɾ̪e
Passedbaboyˈba.boɪ̯ˈba.boɪ̯
Passedbukidˈbu.kɪd̪ˈbu.kɪd̪
Passedbulanˈbu.l̪ɐn̪ˈbu.l̪ɐn̪
Passedbuwanˈbu.wɐn̪ˈbu.wɐn̪
Passeddyaketˈd̪ja.ket̪ˈd̪ja.ket̪
Passedinahanʔɪˈn̪a.hɐn̪ʔɪˈn̪a.hɐn̪
Passedkongresokoŋˈɡɾ̪i.s̪okoŋˈɡɾ̪i.s̪o
Passedlimpiyoˈl̪im.pjoˈl̪im.pjo
Passednganoˈŋa.n̪oˈŋa.n̪o
Passedpekeˈpi.keʔˈpi.keʔ
Passedtawoˈt̪a.woˈt̪a.wo
Passedtsekeˈt̪s̪i.keˈt̪s̪i.ke
Passedtuoˈt̪u.ʔoˈt̪u.ʔo

local tests = require("Module:UnitTests")
local m_ceb_pron = require("Module:ceb-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 .. "#Cebuano|" .. text .. "]]",
		m_ceb_pron.IPA(respelling)["phonetic"],
		expected,
		{ display = tag_IPA }
	)
end

function tests:test_phonetic_pron()
	local examples = {
		{ "aksiyon","ʔɐkˈs̪jon̪", "aksiyón" },
        { "alambre", "ʔɐˈl̪am.bɾ̪e", "alambre" },
        { "baboy", "ˈba.boɪ̯", "baboy" },
        { "bukid", "ˈbu.kɪd̪", "bukid" },
        { "bulan", "ˈbu.l̪ɐn̪", "bulan" },
        { "buwan", "ˈbu.wɐn̪", "buwan" },
        { "dyaket", "ˈd̪ja.ket̪", "dyaket" },
        { "inahan", "ʔɪˈn̪a.hɐn̪", "inahan"},
        { "kongreso", "koŋˈɡɾ̪i.s̪o", "kon.greso"},
        { "limpiyo", "ˈl̪im.pjo", "limpyo" },
        { "ngano", "ˈŋa.n̪o", "ngano" },
        { "peke", "ˈpi.keʔ", "pekè" },
        { "tawo", "ˈt̪a.wo", "tawo" },
        { "tseke", "ˈt̪s̪i.ke", "tseke" },
        { "tuo", "ˈt̪u.ʔo", "tu7o" },
	}
	self:iterate(examples, "check_phonetic_ipa")
end


return tests