Jump to content

Module:ckb-pron/testcases

From Wiktionary, the free dictionary

All tests passed. (refresh)

TextExpectedActualDiffers at
test_all:
Passedئۆین (oyn)ʔoːi̯nʔoːi̯n
Passedبۆر (bor)bɔːɾbɔːɾ
Passedپەیژە (peyje)pɛi̯ʒapɛi̯ʒa
Passedتۆو (tow)toːu̯toːu̯
Passedتۆواو (towaw)to̞ːwaːu̯to̞ːwaːu̯
Passedخووی (xûy)xuːi̯xuːi̯
Passedدەعبا (de'ba)daʕbaːdaʕbaː
Passedدێی (dêy)deːi̯deːi̯
Passedڕۆژ (roj)ro̞ːʒro̞ːʒ
Passedشوێن (şwên)ʃøe̯nʃøe̯n
Passedقاز (qaz)qaːzqaːz
Passedقورئان (qur'an)qʊɾʔaːnqʊɾʔaːn
Passedکەونار (kewnar)kau̯naːɾkau̯naːɾ
Passedکێو (kêw)ceːu̯ceːu̯
Passedگەرم (germ)ɡaɾmɡaɾm
Passedگێژ (gêj)ɟe̞ːʒɟe̞ːʒ
Passedمانگ (mang)maːŋɡmaːŋɡ
Passedنیو (nîw)niːu̯niːu̯
Passedیەک (yek)jɛkjɛk

local tests = require("Module:UnitTests")
local m_IPA = require("Module:ckb-pron")
local lang = require("Module:languages").getByCode("ckb")

function link(term)
	return require("Module:links").full_link {term = term, lang = lang}
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.phonemic(term), expected, options)
end

function tests:test_all()
	examples = {
		{"ئۆین", "ʔoːi̯n"},
		{"بۆر", "bɔːɾ"},
		{"پەیژە", "pɛi̯ʒa"},
		{"تۆو", "toːu̯"},
		{"تۆواو", "to̞ːwaːu̯"},
		{"خووی", "xuːi̯"},
		{"دەعبا", "daʕbaː"},
		{"دێی", "deːi̯"},
		{"ڕۆژ", "ro̞ːʒ"},
		{"شوێن", "ʃøe̯n"},
		{"قاز", "qaːz"},
		{"قورئان", "qʊɾʔaːn"},
		{"کەونار", "kau̯naːɾ"},
		{"کێو", "ceːu̯"},
		{"گەرم", "ɡaɾm"},
		{"گێژ", "ɟe̞ːʒ"},
		{"مانگ", "maːŋɡ"},
		{"نیو", "niːu̯"},
		{"یەک", "jɛk"}
	}

	tests:iterate(examples, "check_pron")
end

return tests