local tests = require("Module:UnitTests")
local m_auto = require("Module:auto cat")
function tests:check(title, expected)
self:equals(
"[[:Kategori:" .. title .. "|" .. title .. "]]",
m_auto.test(title),
expected,
{
display = function(template)
return "[[Templat:" .. template .. "|" .. template .. "]]"
end
}
)
end
function tests:test_langcatboiler()
-- langcatboiler not enabled by default because it requires additional args
-- self:check('German language', 'langcatboiler')
self:check('Bahasa pengaturcaraan Java', 'topic cat')
self:check('Kata nama mengikut bahasa', 'poscatboiler')
-- langcatboiler not enabled by default because it requires additional args
-- self:check('American Sign Language', 'langcatboiler')
end
function tests:test_family_cat()
self:check('Bahasa-bahasa Austronesia', 'family cat')
self:check('Perkataan diterbitkan daripada bahasa Melayu', 'poscatboiler')
self:check('Bahasa komputer', 'topic cat')
self:check('ms:Bahan', 'topic cat')
self:check('Perkataan diterbitkan daripada bahasa kreol atau pijin', 'poscatboiler')
-- self:check('Egyptian hieroglyphic script languages', 'scriptcatboiler')
self:check('Bahasa pupus', 'topic cat')
self:check('Bahasa campuran', 'family cat')
self:check('Perkataan diterbitkan daripada bahasa substratum', 'poscatboiler')
self:check('nama diri bahasa Melayu dari bahasa Arab', 'name cat')
self:check('nama diri bahasa Melayu', 'poscatboiler')
end
function tests:test_language_splitter()
-- Autocat must grab "Norwegian Nynorsk" and not "Norwegian" as the language
-- name here.
self:check('Norwegian Nynorsk words prefixed with des-', 'prefix cat')
end
return tests