local t = require("Modul:UnitTests")
local mut = require("Modul:ca-subst")
local function nowikiPipe(str)
return mw.ustring.gsub(str, "|", "<nowiki>|</nowiki>")
end
function t:test01_basic()
self:equals_deep('mut.test("forn", "ca-subst-m", "export")', mut.test("forn", "ca-subst-m", "export"),
{
sing="forn",
plur="forns"
}
)
self:equals_deep('mut.test("flor", "ca-subst-f", "export")', mut.test("flor", "ca-subst-f", "export"),
{
sing="flor",
plur="flors"
}
)
end
function t:test02_a_ending()
self:equals_deep('mut.test("cervesa", "ca-subst-f", "export")', mut.test("cervesa", "ca-subst-f", "export"),
{
sing="cervesa",
plur="cerveses"
}
)
self:equals_deep('mut.test("pianista", "ca-subst-mf", "export")', mut.test("pianista", "ca-subst-mf", "export"),
{
sing="pianista",
plur="pianistes"
}
)
end
function t:test03_ca_ending()
self:equals_deep('mut.test("tècnica", "ca-subst-f", "export")', mut.test("tècnica", "ca-subst-f", "export"),
{
sing="tècnica",
plur="tècniques"
}
)
end
function t:test04_accent_ending()
self:equals_deep('mut.test("americà", "ca-subst-m", "export")', mut.test("americà", "ca-subst-m", "export"),
{
sing="americà",
plur="americans"
}
)
self:equals_deep('mut.test("estació", "ca-subst-f", "export")', mut.test("estació", "ca-subst-f", "export"),
{
sing="estació",
plur="estacions"
}
)
end
function t:test05_accent_s_ending()
self:equals_deep('mut.test("danès", "ca-subst-m", "export")', mut.test("danès", "ca-subst-m", "export"),
{
sing="danès",
plur="danesos"
}
)
self:equals_deep('mut.test("abús", "ca-subst-m", "export")', mut.test("abús", "ca-subst-m", "export"),
{
sing="abús",
plur="abusos"
}
)
end
function t:test06_os_ending()
self:equals_deep('mut.test("gos", "ca-subst-m", "export")', mut.test("gos", "ca-subst-m", "export"),
{
sing="gos",
plur="gossos"
}
)
end
function t:test07_s_ending()
self:equals_deep('mut.test("mes", "ca-subst-m", "export")', mut.test("mes", "ca-subst-m", "export"),
{
sing="mes",
plur="mesos"
}
)
self:equals_deep('mut.test("arqueòpterix", "ca-subst-m", "export")', mut.test("arqueòpterix", "ca-subst-m", "export"),
{
sing="arqueòpterix",
plur="arqueòpterixos"
}
)
self:equals_deep('mut.test("abkhaz", "ca-subst-m", "export")', mut.test("abkhaz", "ca-subst-m", "export"),
{
sing="abkhaz",
plur="abkhazos"
}
)
end
function t:test08_aig_ending()
self:equals_deep('mut.test("assaig", "ca-subst-m", "export")', mut.test("assaig", "ca-subst-m", "export"),
{
sing="assaig",
plur="assajos"
}
)
end
function t:test09_ig_ending()
self:equals_deep('mut.test("desig", "ca-subst-m", "export")', mut.test("desig", "ca-subst-m", "export"),
{
sing="desig",
plur="desigs, desitjos"
}
)
end
function t:test10_gua_ending()
self:equals_deep('mut.test("aigua", "ca-subst-f", "export")', mut.test("aigua", "ca-subst-f", "export"),
{
sing="aigua",
plur="aigües"
}
)
end
function t:test11_ja_ending()
self:equals_deep('mut.test("taronja", "ca-subst-f", "export")', mut.test("taronja", "ca-subst-f", "export"),
{
sing="taronja",
plur="taronges"
}
)
self:equals_deep('mut.test("platja", "ca-subst-f", "export")', mut.test("platja", "ca-subst-f", "export"),
{
sing="platja",
plur="platges"
}
)
end
function t:test12_accented_os_ending()
self:equals_deep('mut.test("intradós", "ca-subst-f", "export")', mut.test("intradós", "ca-subst-f", "export"),
{
sing="intradós",
plur="intradossos"
}
)
end
return t