Module:User:Oyunqi/ug-headword2/testcases

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

1 of 15 tests failed. (refresh)

TextExpectedActual
test_noun_plurals:
nouns back
Passedبالا {{ug-headword}}بالىلاربالىلار
Passedبالا {{ug-headword|change=no}}بالالاربالالار
Passedنان {{ug-headword}}نانلارنانلار
Passedقوي {{ug-headword}}قويلارقويلار
nouns front
Passedئائىلە {{ug-headword}}ئائىلىلەرئائىلىلەر
Passedگۈل {{ug-headword}}گۈللەرگۈللەر
nouns ending with چە
Passedزىخچە {{ug-headword}}زىخچىلارزىخچىلار
Passedقىرغىزچە {{ug-headword}}قىرغىزچىلارقىرغىزچىلار
Passedئۈنچە {{ug-headword}}ئۈنچىلەرئۈنچىلەر
Passedغۇنچە {{ug-headword}}غۇنچىلارغۇنچىلار
nouns central
Passedبىخ {{ug-headword}}بىخلاربىخلار
Passedتىل {{ug-headword}}تىللارتىللار
nouns exception
Passedبىلىم {{ug-headword}}بىلىملەربىلىملەر
Passedقىل {{ug-headword}}قىللارقىللار
Failedكىر {{ug-headword}}كىرلاركىرلەر

Lua error in Module:module_categorization at line 298: Could not infer any languages or scripts from root pagename 'User:Oyunqi'


local tests = require("Module:UnitTests")
local make_plural_noun = require("Module:User:Oyunqi/ug-headword2").make_plural_noun

local function link(word)
	return "[[" .. word .. "#Uyghur|" .. word .. "]]"
end

function get_Tempalte(vv, change)
	local par = ""
	if vv and vv ~= "" then par = par .. "|" .. vv  end
	if change and change ~= "" then par = par .. "|change=" .. change end
	str = "<code><b>{{ug-headword".. mw.text.nowiki(par) .."}}</b></code>"
    return str
end

function tests:check_noun_plurals(singular, expected_plural, vv, change)
	temp = change
	if not temp then temp = "yes" end
	local test = make_plural_noun(singular, vv, temp)
	local comment = get_Tempalte(vv, change)
	
	self:equals(link(singular) .. " " .. get_Tempalte(vv, change),
		test,
		expected_plural)
end

function tests:test_noun_plurals()
	local examples = {
		"nouns back",
		{"بالا", "بالىلار"},
		{"بالا", "بالالار","", "no"},
		{"نان", "نانلار"},
		{"قوي", "قويلار"},
		
		"nouns front",
		{"ئائىلە", "ئائىلىلەر"},
		{"گۈل", "گۈللەر"},
		
		"nouns ending with چە",
		{"زىخچە", "زىخچىلار"},
		{"قىرغىزچە", "قىرغىزچىلار"},
		{"ئۈنچە", "ئۈنچىلەر"},
		{"غۇنچە", "غۇنچىلار"},

		"nouns central",
		{"بىخ", "بىخلار"},
		{"تىل", "تىللار"},
		
		"nouns exception",
		{"بىلىم", "بىلىملەر"},
		{"قىل", "قىللار"},
		{"كىر", "كىرلار"},
	}
	
	tests:iterate(examples, "check_noun_plurals")
end

return tests