Module:cbk-pronunc/testcases

tests = require("Module:UnitTests") local m_cbk_pronunc = require("Module:cbk-pronunc") local m_links = require('Module:links')

local options = { display = tag_IPA }

local cbk = require('Module:languages').getByCode('cbk')

local function cbk_IPA(IPA) return ' ' .. IPA .. ' ' end local function link(text) return m_links.full_link{ term = text, lang = cbk } end

function tests:check_phonetic_ipa(word, expected, respelling) self:equals(		link(word) ..			(respelling and (" (respelled " .. respelling .. ")") or ""),		m_cbk_pronunc.IPA(word or respelling, true),		expected,		{ display = cbk_IPA }	) end

function tests:test_phonetic_pron local examples = { { "accidente", "aɡ.siˈd̪ẽn̪.t̪e" }, { "banco", "ˈbãŋ.ko"}, { "batà", "ˈba.t̪aʔ" }, { "casa", "ˈka.sa" }, { "Chavacano", "t͡ʃa.baˈka.no" }, { "colegio", "koˈle.xjo" }, { "Dios", "ˈd͡ʒos" }, { "dulce", "ˈd̪ul.se" }, { "estrellas", "es̪ˈt̪ɾe.ʎas" }, { "Estados Unidos", "es̪ˌt̪a.d̪os uˈni.d̪os" }, { "estación", "es̪.t̪aˈʃõn"}, { "gente", "ˈxẽn̪.t̪e" }, { "guerra", "ˈɡe.ra" }, { "honra", "ˈõn.ra"}, { "hoy", "ˈoi̯"}, { "lápiz", "ˈla.pis"}, { "pollo", "ˈpo.ʎo" }, { "raíz", "raˈis"}, { "sol", "ˈsol" }, { "soldao", "sol̪ˈd̪a.o" }, { "tanque", "ˈt̪ãŋ.ke"}, { "tierra", "ˈt͡ʃe.ra"}, { "yo", "ˈɟ͡ʝo"}, }	self:iterate(examples, "check_phonetic_ipa") end

return tests