Jump to content

Module:inc-mbn-IPA/testcases

From Wiktionary, the free dictionary

1 of 0 tests failed. (refresh)

TextExpectedActualComments
test_all:
Script error during testing: Module:inc-mbn-IPA/testcases:10: attempt to call field 'link' (a nil value)
stack traceback:
	[C]: in function 'link'
	Module:inc-mbn-IPA/testcases:10: in function 'func'
	Module:UnitTests:296: in function 'iterate'
	Module:inc-mbn-IPA/testcases:45: in function <Module:inc-mbn-IPA/testcases:17>
	(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:inc-mbn-IPA")

local function tag_IPA(IPA)
	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)),
		tag_IPA(expected),
		{ comment = comment }
	)
end

function tests:test_all()
	examples = {
        { "আহ্মে", "ɑmɦe" },
        { "উলাক", "ulɑk" },
        { "গহির", "ɡɒ(ɦ)iɾ(ɒ)" },
        { "টঙ্কা", "ʈɒŋkɑ" },
        { "ঠাঞি", "ʈʰɑ̃i̯" },
        { "নই", "nɔi̯" },
        { "নাঅ", "nɑ(o̯)ɒ"},
        { "বড়ায়ি", "bɒɽɑi̯" },
        { "বাঁশী", "bɑ̃ʃi" },
        { "বিহাণ", "bi(ɦ)ɑɳ(ɒ)" },
        { "বেআকুল", "bɛ(e̯)ɑkul(ɒ)"},
        { "বেলা", "bɛlɑ" },
        { "মন", "mɒɳ(ɒ)" },
        { "মেকুর", "mekuɾ" },
		{ "মোর", "moɾ(ɒ)" },
        { "যমুনা", "d͡ʒɒw̃unɑ" },
        { "যেহ্ন", "d͡ʒɛnɦɒ" },
        { "রান্ধন", "ɾɑnd̪ʱɒn(ɒ)" },
        { "রেপট", "ɾepɒʈ" },
        { "সত্বর", "ʃɒt̪ːo̯ɔɾɒ" },

	}
--[[	Copy the following to add more examples:
		{ "", "" },
]]
	
	tests:iterate(examples, "check_output")
end

return tests