Module:as-IPA/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

4 of 21 tests failed. (refresh)

TextExpectedActualComments
test_all:
Passedমই (moi)mɔɪmɔɪ
Passedদেশ (dex)dɛxdɛx
Passedমোৰ (mür)mʊɹmʊɹ
Passedশক্তি (xokti)xɔk.tixɔk.ti
Passedঔষধ (ouxodh)oʊ.xɔdʱoʊ.xɔdʱ
Failedপৰিয়াল (porial)po.ɹialpɔ.ɹial
Passedসোঁফালে (xü̃phale)xʊ̃.pʰa.lɛxʊ̃.pʰa.lɛ
Passedস্পৰ্শ (sporxo)spɔɹ.xɔspɔɹ.xɔ
Passedনাঙল (naṅol)na.ŋɔlna.ŋɔl
Passedহিংসা (hiṅxa)ɦiŋ.xaɦiŋ.xa
Passedঐতিহাসিক (oitihaxik)oɪ.ti.ɦa.xikoɪ.ti.ɦa.xik
Failedশহা পহু (xoha pohu)xɔ.ɦa po.ɦuxɔ.ɦa pɔ.ɦu
Passedসম্পূৰ্ণ (xompurno)xɔm.puɹ.nɔxɔm.puɹ.nɔ
Failedমগজু (mogozu)mo.ɡo.zumɔ.ɡɔ.zu
Passedবিৱৰণ (biworon)bi.wɔ.ɹɔnbi.wɔ.ɹɔn
Passedৰাজ্য (raizzo)ɹaɪd.ʑɔɹaɪd.ʑɔ
Passedজ্বৰ (zor)zɔɹzɔɹ
Failedঅধিকাৰ (odhikar)o.dʱi.kaɹɔ.dʱi.kaɹ
Passedথকা (thoka)tʰɔ.katʰɔ.ka
Passedখেল (khel)kʰɛlkʰɛl
Passedমানুহ (manuh)ma.nuʱma.nuʱ

local tests = require("Module:UnitTests")
local m_IPA = require("Module:as-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ɔɪ" },
        { "দেশ", "dɛx" },
        { "মোৰ", "mʊɹ"},
        { "শক্তি", "xɔk.ti" },
        { "ঔষধ", "oʊ.xɔdʱ" },
        { "পৰিয়াল", "po.ɹial" },
        { "সোঁফালে", "xʊ̃.pʰa.lɛ" },
        { "স্পৰ্শ", "spɔɹ.xɔ" },
        { "নাঙল", "na.ŋɔl"},
        { "হিংসা", "ɦiŋ.xa" },
        { "ঐতিহাসিক", "oɪ.ti.ɦa.xik" },
        { "শহা পহু", "xɔ.ɦa po.ɦu" },
        { "সম্পূৰ্ণ", "xɔm.puɹ.nɔ" },
        { "মগজু", "mo.ɡo.zu" },
        { "বিৱৰণ", "bi.wɔ.ɹɔn"},
        {"ৰাজ্য", "ɹaɪd.ʑɔ"},
        {"জ্বৰ", "zɔɹ"},
        {"অধিকাৰ", "o.dʱi.kaɹ"},
        {"থকা", "tʰɔ.ka"},
        {"খেল", "kʰɛl"},
        {"মানুহ", "ma.nuʱ"},

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

return tests