Jump to content

Module:auto cat/testcases

Wiktionary වෙතින්
local tests = require("Module:UnitTests")
local m_auto = require("Module:auto cat")

function tests:check(title, expected)
	self:equals(
		"[[:Category:" .. title .. "|" .. title .. "]]",
		m_auto.test(title),
		expected,
		{
			display = function(template)
				return "[[Template:" .. 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('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
"https://si.wiktionary.org/w/index.php?title=Module:auto_cat/testcases&oldid=40852" වෙතින් සම්ප්‍රවේශනය කෙරිණි