Module:User:Oyunqi/ug-headword2/testcases

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

local function link(word) return "" .. 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 = " " 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