Module:auto cat/testcases

local tests = require("Module:UnitTests") local m_auto = require("Module:auto cat")

function tests:check(title, expected) self:equals(		"" .. title .. "",		m_auto.test(title),		expected,		{			display = function(template)				return "" .. template .. ""			end		}	) end

function tests:test_langcatboiler -- langcatboiler not enabled by default because it requires additional args -- self:check('German language', 'langcatboiler') self:check('Java programming language', 'topic cat') self:check('Nouns by language', '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('Indo-European languages', 'family cat') self:check('Terms derived from Romance languages', 'poscatboiler') self:check('Computer languages', 'topic cat') self:check('fr:Computer languages', 'topic cat') self:check('Terms derived from creole or pidgin languages', 'poscatboiler') -- self:check('Egyptian hieroglyphic script languages', 'scriptcatboiler') self:check('Extinct languages', 'topic cat') self:check('Mixed languages', 'family cat') self:check('Terms derived from substrate languages', 'poscatboiler') self:check('English given names from Austronesian languages', 'name cat') self:check('English given names', '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