Module:sk-IPA/testcases

local tests = require('Module:UnitTests') local m_IPA = require('Module:sk-IPA') local m_links = require("Module:links")

local lang = require("Module:languages").getByCode("sk") local sc = require("Module:scripts").getByCode("Latn")

local function tag_IPA(IPA) return ' ' .. IPA .. ' ' end

function tests:check_output(term, expected) tests:equals(		m_links.full_link({ term = term, lang = lang, sc = sc } ),		m_IPA.toIPA(term),		expected,		{ display = tag_IPA }	) end

function tests:test_all local examples = { { "mäso", "ˈmɛɐ̯sɔ" }, { "ďakovať", "ˈɟakɔvac" }, { "chlieb", "xli̯ep" }, { "štvrť", "ʃtvr̩c" }, { "vĺča", "ˈvl̩ːt͡ʃa" }, { "vŕba", "ˈvr̩ːba" }, { "kôň", "ku̯oɲ" }, { "čln", "t͡ʃl̩n" }, { "šmrnc", "ʃmr̩nt͡s" }, -- palatalisation is expected for d, t, n and l before e and i (there are exceptions to be respelled) { "detstvo", "ˈɟet͡stvɔ" }, { "leto", "ˈʎetɔ" }, { "nebo", "ˈɲebɔ" }, { "deti", "ˈɟeci" }, }	self:iterate(examples, "check_output") --	additions take this form:		{ "", "" }, end

return tests