বিষয়বস্তুতে চলুন

মডিউল:eo-headword/testcases

উইকিঅভিধান, মুক্ত অভিধান থেকে

এই মডিউলের জন্য মডিউল:eo-headword/testcases/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে

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