Jump to content

Module:eu-pron/testcases

From Wiktionary, the free dictionary

1 of 0 tests failed. (refresh)

TextExpectedActualDiffers at
test_pron:
Script error during testing: Module:eu-pron/testcases:15: attempt to call field 'pronunciation' (a nil value)
stack traceback:
	[C]: in function 'pronunciation'
	Module:eu-pron/testcases:15: in function 'func'
	Module:UnitTests:296: in function 'iterate'
	Module:eu-pron/testcases:35: in function <Module:eu-pron/testcases:18>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:370: in function <Module:UnitTests:329>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:896: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

local tests = require('Module:UnitTests')
local m_IPA = require('Module:eu-pron')

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

function link(term)
    return require("Module:links").full_link {term = term, lang = lang, sc = sc}
end

local function tag_IPA(IPA) return '<span class="IPA">' .. IPA .. '</span>' end
local options = { display = tag_IPA }

function tests:check_pron(term, expected)
    tests:equals(link(term), m_IPA.pronunciation(term), expected, options)
end

function tests:test_pron()
    local examples = {
        {"abantaila", "a.ban.ta.ʎa"}, {"aberats", "a.be.ɾat͡s̺"},
        {"Afrika Erdiko Errepublika", "a.fri.ka er.di.ko e.re.pu.bli.ka"},
        {"Ainhoa", "ai.no.a"}, {"Aintzane", "ain.t͡s̻a.ne"},
        {"aktibatze", "ak.ti.ba.t͡s̻e"}, {"albanieraz", "al.ba.nje.ɾas̻"},
        {"ardo beltz", "ar.do belt͡s̻"}, {"aroztegi", "a.ɾos̻.te.ɡi"},
        {"dabilela", "da.bi.ʎe.la"}, {"enparantza", "em.pa.ɾan.t͡s̻a"},
        {"erdiko", "er.di.ko"}, {"errepublika", "e.re.pu.bli.ka"},
        {"gainditu", "ɡain.di.tu"}, {"gau", "ɡau"},
        {"gauetako", "ɡau.e.ta.ko"}, {"heri.otz", "(ɦ)e.ɾi.ot͡s̻"},
        {"herrikoi", "(ɦ)e.ri.koi"}, {"ilun", "i.ʎun"}, {"ilertz", "i.ʎert͡s̻"},
        {"ingeles", "in.ɡe.les̺"}, {"inoiz", "i.ɲois̻"}, {"lehoia", "le.(ɦ)oi.a"},
        {"Leioa", "lei.o.a"}, {"mailetako", "ma.ʎe.ta.ko"}, {"min", "miɲ"},
        {"mina", "mi.ɲa"}, {"mintzatzen", "min.t͡s̻a.t͡s̻en"}
    }

    tests:iterate(examples, "check_pron")
end

return tests