Jump to content

Module:kjl-IPA/testcases

From Wiktionary, the free dictionary

1 of 0 tests failed. (refresh)

TextExpectedActualComments
test_phonetic:
Script error during testing: Module:kjl-IPA:94: attempt to concatenate global 'Kham' (a nil value)
stack traceback:
	[C]: ?
	Module:kjl-IPA:94: in function 'toIPA'
	Module:kjl-IPA/testcases:15: in function 'func'
	Module:UnitTests:296: in function 'iterate'
	Module:kjl-IPA/testcases:33: in function <Module:kjl-IPA/testcases:21>
	(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:kjl-IPA")

local function tag_IPA(IPA)
		if phonetic then
			IPA = '/' .. IPA .. '/'
		else
			IPA = '[' .. IPA .. ']'
		end
	return '<span class="IPA">' .. IPA .. '</span>'
end
function tests:check_output(term, expected, comment)
	self:equals(
		m_IPA.link(term),
		tag_IPA(m_IPA.toIPA(term, "standard")),
		tag_IPA(expected),
		{ comment = comment }
	)
end

function tests:test_phonetic()
	examples = {
        { "ज़ा", "zɐ" },
        { "झङ", "d͡zə̤ŋ" },
        { "झ़ार", "zɐ̤r" },
        { "व़ाः", "ɥɐ̤" },
        { "ह्व़े", "ɥ̊e" },
        { "ह्लेपा", "ɬe.pɐ" },
        { "बोङ्दै", "boŋ.dəj" },
        { "कलिःङ्गा", "kə.li̤ŋ.ɡɐ" },
        { "चोः", "t͡so̤" },
	}
tests:iterate(examples, "check_output")

end

return tests