Module:es-headword/testcases

Hello, you have come here looking for the meaning of the word Module:es-headword/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:es-headword/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:es-headword/testcases in singular and plural. Everything you need to know about the word Module:es-headword/testcases you have here. The definition of the word Module:es-headword/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:es-headword/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

2 of 0 tests failed. (refresh)

TextExpectedActual
test_adjective_forms:
ending in -o
Script error during testing: Module:es-headword/testcases:20: attempt to call upvalue 'adjective_forms' (a nil value)
stack traceback:
	: in function 'adjective_forms'
	Module:es-headword/testcases:20: in function 'func'
	Module:UnitTests:296: in function 'iterate'
	Module:es-headword/testcases:166: in function <Module:es-headword/testcases:124>
	(tail call): ?
	: in function 'xpcall'
	Module:UnitTests:370: in function <Module:UnitTests:329>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	: ?
	: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:896: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	: ?
TextExpectedActual
test_noun_plurals:
nouns ending in unstressed vowel or á, é, ó
Script error during testing: Module:es-headword/testcases:10: attempt to call upvalue 'make_plural_noun' (a nil value)
stack traceback:
	: in function 'make_plural_noun'
	Module:es-headword/testcases:10: in function 'func'
	Module:UnitTests:296: in function 'iterate'
	Module:es-headword/testcases:121: in function <Module:es-headword/testcases:27>
	(tail call): ?
	: in function 'xpcall'
	Module:UnitTests:370: in function <Module:UnitTests:329>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	: ?
	: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:896: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	: ?

local tests = require("Module:UnitTests")
local make_plural_noun = require("Module:es-headword").make_plural_noun
local adjective_forms = require("Module:es-headword").adjective_forms

local function link(word)
	return "]"
end

function tests:check_noun_plurals(singular, expected_plural, gender)
	local r = make_plural_noun(singular, gender)
	local test = r.pl
	if r.pl2 then test = test .. ", " .. r.pl2 end
	
	self:equals(link(singular),
		test,
		expected_plural)
end

function tests:check_adjective_forms(singular, expected_forms, gender)
	local forms = adjective_forms(singular, gender)
	
	self:equals(link(singular),
		forms.ms .. ", " .. forms.mp .. ", " .. forms.fs .. ", " .. forms.fp,
		expected_forms.ms .. ", " .. expected_forms.mp .. ", " .. expected_forms.fs .. ", " .. expected_forms.fp)
end

function tests:test_noun_plurals()
	local examples = {
		"nouns ending in unstressed vowel or á, é, ó",
		{"pera", "peras"},
		{"bota", "botas"},
		{"sonido", "sonidos"},
		{"panti", "pantis"},
		{"café", "cafés"},
		{"papá", "papás"},
		{"buró", "burós"},
		
		"nouns ending in í or ú",
		{"tisú", "tisús, tisúes"},
		{"tabú", "tabús, tabúes"},
		{"israelí", "israelís, israelíes"},
		{"marroquí", "marroquís, marroquíes"},
		
		"nouns ending in a vowel + y, l, r, n, d, j, or ch",
		{"rey", "reyes"},
		{"panel", "paneles"},
		{"color", "colores"},
		{"alféizar", "alféizares"},
		{"can", "canes"},
		{"césped", "céspedes"},
		{"reloj", "relojes"},
		{"sándwich", "sándwiches"},
		{"orden", "órdenes"},
		{"volumen", "volúmenes"},
		{"brasil", "brasiles"},
		{"níquel", "níqueles"}, -- maybe shouldn't have a plural, but ...
		{"íleon", "íleones"},

		"single syllable, ending in s or x",
		{"mes", "meses"},
		{"fax", "faxes"},
		
		"nouns ending in a vowel + z",
		{"luz", "luces"},
		{"lápiz", "lápices"},
		{"actriz", "actrices"},
		{"voz", "voces"},
		{"maíz", "maíces"},
		
		"noun ending in tz",
		{"kibbutz", "kibbutz"},
		
		"nouns ending in a stressed vowel + consonant",
		{"botón", "botones"},
		{"compás", "compases"},
		{"acreditación", "acreditaciones"},
		{"champiñón", "champiñones"},
		{"tahúr", "tahúres"},
		
		"nouns ending in a consonant cluster",
		{"iceberg", "icebergs"},
		
		"nouns ending in a vowel + a consonant other than l, r, n, d, z, j, s, x, or ch",
		{"esnob", "esnobs"},
		{"zigzag", "zigzags"},
		{"crac", "cracs"},
		{"mamut", "mamuts"},
		
		"nouns ending in s or x with more than 1 syllable, last syllable unstressed",
		{"análisis", "análisis"},
		{"jueves", "jueves"},
		{"lunes", "lunes"},
		{"tórax", "tórax"},
		{"cóccix", "cóccix"},
		{"ibex", "ibex"},
		{"carcax", "carcax"},
		{"bíceps", "bíceps"},
		
		"nouns ending in l, r, n, d, z, j, 3 or more syllables, accented on third to last syllable",
		{"polisíndeton", "polisíndeton"},
		
		"noun + adjective",
		{"número arábigo", "números arábigos", "m"},
		{"fórmula química", "fórmulas químicas", "f"},
		{"accidente cerebrovascular", "accidentes cerebrovasculares", "m"},
		{"arándano azul", "arándanos azules", "m"},
		{"avión común", "aviones comunes", "m"},
		{"católica romana", "católicas romanas", "f"},
		
		"noun + prepositional phrase (de, del)",
		{"hombre de letras", "hombres de letras"},
		{"hombre del mundo", "hombres del mundo"},
		{"acero al carbono", "aceros al carbono"},

		"other",
		{"esmoquin", "esmóquines"},
		{"guion", "guiones"},
		{"ciempiés", "ciempiés"}
	}
	
	tests:iterate(examples, "check_noun_plurals")
end

function tests:test_adjective_forms()
	local examples = {
		"ending in -o",
		{"ponzoñoso", { = "ponzoñoso",  = "ponzoñosos",  = "ponzoñosa",  = "ponzoñosas"}},
		
		"ending in -a",
		{"química", { = "químico",  = "químicos",  = "química",  = "químicas"}, "f"},
		
		"ending in -e",
		{"tolerable",  { = "tolerable",  = "tolerables",  = "tolerable",  = "tolerables"}},
		
		"ending in -ista",
		{"culturalista",  { = "culturalista",  = "culturalistas",  = "culturalista",  = "culturalistas"}},
		
		"ending in -z",
		{"feliz",  { = "feliz",  = "felices",  = "feliz",  = "felices"}},
		
		"ending in -or",
		{"ahorrador",  { = "ahorrador",  = "ahorradores",  = "ahorradora",  = "ahorradoras"}, "m"},
		{"ahorradora", { = "ahorrador",  = "ahorradores",  = "ahorradora",  = "ahorradoras"}, "f"},
		{"superior",  { = "superior",  = "superiores",  = "superior",  = "superiores"}, "m"},
		
		"ending in -ón",
		{"alegrón",  { = "alegrón",  = "alegrones",  = "alegrón",  = "alegrones"}},
		
		"ending in -ín",
		{"cantarín",  { = "cantarín",  = "cantarines",  = "cantarina",  = "cantarinas"}},
		
		"ending in -l",
		{"aluvial",  { = "aluvial",  = "aluviales",  = "aluvial",  = "aluviales"}},
		{"civil",  { = "civil",  = "civiles",  = "civil",  = "civiles"}},
		
		"ending in -ar",
		{"auxiliar", {= "auxiliar",  = "auxiliares",  = "auxiliar",  = "auxiliares"}},
		
		"ending in -és",
		{"francés", { = "francés",  = "franceses",  = "francesa",  = "francesas"}},
		
		"ending in -án",
		{"alemán", { = "alemán",  = "alemanes",  = "alemana",  = "alemanas"}}
	}
	
	tests:iterate(examples, "check_adjective_forms")
end
		
return tests