Module:ilo-pron/testcases

tests = require("Module:UnitTests") local m_ilo_pron = require("Module:ilo-pron") local m_links = require('Module:links')

local options = { display = tag_IPA }

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

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

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

function tests:test_phonetic_pron local examples = { { "aldáw","ʔɐlˈdaʊ̯" }, { "baláy","bɐˈlaɪ̯" }, { "bituén","biˈtwen" }, { "Dios","ˈd͡ʒos" }, { "Estados Unidos", "ʔesˌta.dos ʔuˈni.dos" }, { "estasión","ʔes.tɐˈʃon"}, { "inóm","ʔiˈnom"}, }	self:iterate(examples, "check_phonetic_ipa") end

return tests