Module:eo-headword/testcases

1 of 38 tests failed. (refresh)

TextExpectedActual
test_getPOS:
Passedarbonounsnouns
Passedarbonnoun formsnoun forms
Passedarbojnoun formsnoun forms
Passedarbojnnoun formsnoun forms
Passedbluaadjectivesadjectives
Passedakurataadjectivesadjectives
Passedbluanadjective formsadjective forms
Passedbluajadjective formsadjective forms
Passedbluajnadjective formsadjective forms
Passedlarĝeadverbsadverbs
Passedmanĝiverbsverbs
Passedmanĝuverb formsverb forms
Passedmanĝasverb formsverb forms
Passedmanĝisverb formsverb forms
Passedmanĝosverb formsverb forms
Passedmanĝusverb formsverb forms
Passedmanĝantaparticiplesparticiples
Passedmanĝantanparticiplesparticiples
Passedmanĝantajparticiplesparticiples
Passedmanĝantajnparticiplesparticiples
Passedmanĝontaparticiplesparticiples
Passedmanĝontanparticiplesparticiples
Passedmanĝontajparticiplesparticiples
Passedmanĝontajnparticiplesparticiples
Passedmanĝataparticiplesparticiples
Passedmanĝanteparticiplesparticiples
Passedablativo absolutanounsnouns
Passeddamna metalrokonounsnouns
Passedŭatonounsnouns
Passedmitonounsnouns
Passedazotonounsnouns
Passedmonatonounsnouns
Failedmia nomo estasphrasesnouns
Passed9aadjectivesadjectives
Passed9anadjective formsadjective forms
Passed20-aadjectivesadjectives
Passed20-ajadjective formsadjective forms
Passed20-ajnadjective formsadjective forms

local tests = require "Module:UnitTests"
local full_link = require "Module:links".full_link
local lang = require "Module:languages".getByCode "eo"
local function link(word)
	return full_link { term = word, lang = lang }
end

function tests:test_getPOS()
	local examples = {
		{ "arbo", "nouns" },
		{ "arbon", "noun forms" },
		{ "arboj", "noun forms" },
		{ "arbojn", "noun forms" },
		{ "blua", "adjectives" },
		{ "akurata", "adjectives" },
		{ "bluan", "adjective forms" },
		{ "bluaj", "adjective forms" },
		{ "bluajn", "adjective forms" },
		{ "larĝe", "adverbs" },
		{ "manĝi", "verbs" },
		{ "manĝu", "verb forms" },
		{ "manĝas", "verb forms" },
		{ "manĝis", "verb forms" },
		{ "manĝos", "verb forms" },
		{ "manĝus", "verb forms" },
		{ "manĝanta", "participles" },
		{ "manĝantan", "participles" },
		{ "manĝantaj", "participles" },
		{ "manĝantajn", "participles" },
		{ "manĝonta", "participles" },
		{ "manĝontan", "participles" },
		{ "manĝontaj", "participles" },
		{ "manĝontajn", "participles" },
		{ "manĝata", "participles" },
		{ "manĝante", "participles" },
		{ "ablativo absoluta", "nouns" },
		{ "damna metalroko", "nouns" },
		{ "ŭato", "nouns" },
		{ "mito", "nouns" },
		{ "azoto", "nouns" },
		{ "monato", "nouns" },
		{ "mia nomo estas", "phrases" }, -- or nil?
		{ "9a", "adjectives" },
		{ "9an", "adjective forms" },
		{ "20-a", "adjectives" },
		{ "20-aj", "adjective forms" },
		{ "20-ajn", "adjective forms" },
		
		--[[
		-- Copy this to add another term and its POS category:
		{ "", "" },
		-- 
		--]]
	}
	
	local getPOS = require "Module:eo-headword".getPOS
	
	self:iterate(examples,
		function (self, word, poscat)
			self:equals(link(word), getPOS(word), poscat)
		end)
end

return tests