Module:grc-form of/testcases

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

All tests passed. (refresh)

TextExpectedActualComments
test_processing:
Passedp, nom, masc (adjective){"masculine", "nominative", "plural"}{"masculine", "nominative", "plural"}
Passedplural, nominative, masculine (adjective){"masculine", "nominative", "plural"}{"masculine", "nominative", "plural"}
Passedplural, subjunctive (noun)"error""error"Module:grc-form_of:89: The category “mood” is not used by the part of speech “noun”.
Passedmasculine, feminine, plural (noun)"error""error"Module:grc-form_of:16: There were multiple labels belonging to the same category: “gender”: “masculine”, “feminine”.
Passed3, s, aor, subj, act (verb){"third person", "singular", "aorist", "subjunctive", "active"}{"third person", "singular", "aorist", "subjunctive", "active"}
Passedpres, inf, act (verb){"present", "active", "infinitive"}{"present", "active", "infinitive"}
Passed3, s, inf, act (verb)"error""error"Module:grc-form_of:89: The categories “number”, “person” are not used by the part of speech “infinitive”.
Passedpres, inf, act (varb)"error""error"Module:grc-form_of:78: The part of speech “varb” does not have a set of valid inflectional categories.
Passedm, nom, p, part, act (verb){"masculine", "nominative", "plural", "active", "participle"}{"masculine", "nominative", "plural", "active", "participle"}
Passedm, nom, p, part, subj, act (verb)"error""error"Module:grc-form_of:89: The category “mood” is not used by the part of speech “participle”.

local tests = require("Module:UnitTests")

local _process = require("Module:grc-form of").process

local error_messages = {}
local function process(...)
	local success, result = pcall(_process, ...)
	if success then
		return result
	else
		error_messages = result
		return "error"
	end
end

local function display(labels, POS)
	return table.concat(labels, ", ") .. " (" .. POS .. ")"
end

function tests:check_processing(labels, POS, expected)
	local actual = process(labels, POS) -- so that error message is logged when equals_deep is called
	self:equals_deep(display(labels, POS), actual, expected, { comment = error_messages })
end

function tests:test_processing()
	local examples = {
		{ { "p", "nom", "masc" }, "adjective", { "masculine", "nominative", "plural" } },
		{ { "plural", "nominative", "masculine" }, "adjective", { "masculine", "nominative", "plural" } },
		{ { "plural", "subjunctive" }, "noun", "error" },
		{ { "masculine", "feminine", "plural" }, "noun", "error" },
		{ { "3", "s", "aor", "subj", "act" }, "verb", { "third person", "singular", "aorist", "subjunctive", "active" } },
		{ { "pres", "inf", "act" }, "verb", { "present", "active", "infinitive" } },
		{ { "3", "s", "inf", "act" }, "verb", "error" },
		{ { "pres", "inf", "act" }, "varb", "error" },
		{ { "m", "nom", "p", "part", "act" }, "verb", { "masculine", "nominative", "plural", "active", "participle" } },
		{ { "m", "nom", "p", "part", "subj", "act" }, "verb", "error" },
	}
	
	self:iterate(examples, "check_processing")
end

return tests