local tester = require('Module:UnitTests') -- ]
local mod = require('Module:lzz-dec-noun') -- ]
local unpack = unpack or table.unpack -- Lua 5.2 compatibility
function tester:tests_main()
local testcases = {
= {tests = {{"abs2", "კოლეფე"}}},
= {args = { = ""},
tests = {{"gen1", "ტაბაღიშ(ი))"}, {"dat2", "ტაბაღეფეში"}}},
= {args = { = ""},
tests = {{"loc1", "საღანის"}, {"ins1", "საღანითენ"}}},
= {args = { = "given name"},
tests = {{"gen1", "ალიშ"}}},
= {args = { = "მამედი", = "given name"},
tests = {{"lat1", "მამედიშე"}, {"abl1", "მამედიშენ"}}},
= {args = { = "given name"},
tests = {{"adv1", "დავითად"}, {"dat1", "დავითს"}}},
}
for inflTerm, testcase in pairs(testcases) do
local tests = testcase.tests;
local term = testcase.term or inflTerm;
local args = testcase.args or {}
args = term
for _, test in pairs(tests) do
local form, shouldbe = unpack(test)
local testname = form .. ". of " .. term
self:equals(testname, mod.test(args, form), shouldbe, {nowiki = true})
end
end
end
return tester