Module:ceb-pron/sandbox/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ɾ̪ɪʔʌˈl̪am.bɾ̪ɪ
Passedbaboyˈba.boɪ̯ˈba.boɪ̯
Passedbukidˈbu.kɪd̪ˈbu.kɪd̪
Passedbulanˈbu.l̪ʌn̪ˈbu.l̪ʌn̪
Passedbuwanˈbu.ʌn̪ˈbu.ʌn̪
Passeddyaketˈd̪ja.kɪt̪ˈd̪ja.kɪt̪
Passedinahanʔɪˈn̪a.hʌn̪ʔɪˈn̪a.hʌn̪
Passedkongresokɔŋˈɡɾ̪i.s̪ɔkɔŋˈɡɾ̪i.s̪ɔ
Passedlimpiyoˈl̪im.pjɔˈl̪im.pjɔ
Passednganoˈŋa.n̪ɔˈŋa.n̪ɔ
Passedpekeˈpi.kɪʔˈpi.kɪʔ
Passedtawoˈt̪awˈt̪aw
Passedtsekeˈt̪s̪i.kɪˈt̪s̪i.kɪ
Passedtuoˈt̪u.ʔɔˈt̪u.ʔɔ

local tests = require("Module:UnitTests")
local m_ceb_pron = require("Module:ceb-pron/sandbox")

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ɾ̪ɪ", "alambre" },
        { "baboy", "ˈba.boɪ̯", "baboy" },
        { "bukid", "ˈbu.kɪd̪", "bukid" },
        { "bulan", "ˈbu.l̪ʌn̪", "bulan" },
        { "buwan", "ˈbu.ʌn̪", "buwan" },
        { "dyaket", "ˈd̪ja.kɪt̪", "dyaket" },
        { "inahan", "ʔɪˈn̪a.hʌn̪", "inahan"},
        { "kongreso", "kɔŋˈɡɾ̪i.s̪ɔ", "kon.greso"},
        { "limpiyo", "ˈl̪im.pjɔ", "limpyo" },
        { "ngano", "ˈŋa.n̪ɔ", "ngano" },
        { "peke", "ˈpi.kɪʔ", "pekè" },
        { "tawo", "ˈt̪aw", "tawo" },
        { "tseke", "ˈt̪s̪i.kɪ", "tseke" },
        { "tuo", "ˈt̪u.ʔɔ", "tu7o" },
	}
	self:iterate(examples, "check_phonetic_ipa")
end


return tests