Module:families/testcases

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

1 of 8 tests failed. (refresh)

TextExpectedActual
test_getCanonicalName:
PassedroaRomanceRomance
PassedgemGermanicGermanic
TextExpectedActual
test_getWikidataItem:
PassedroaQ19814Q19814
PassedgemQ21200Q21200
TextExpectedActual
test_makeWikipediaLink:
Passedroa[[w:Romance languages|Romance]][[w:Romance languages|Romance]]
Passedgem[[w:Germanic languages|Germanic]][[w:Germanic languages|Germanic]]
Passedsgn-jsl[[w:Japanese Sign Language family|Japanese Sign Languages]][[w:Japanese Sign Language family|Japanese Sign Languages]]
TextExpectedActual
test_toJSON:
Failedroa-JSON{"type" : "family", "wikidataItem" : "Q19814", "code" : "roa", "canonicalName" : "Romance", "otherNames" : , "categoryName" : "Romance languages", "family" : "itc"}{"type" : , "code" : "roa", "canonicalName" : "Romance", "aliases" : , "wikidataItem" : "Q19814", "varieties" : , "protoLanguage" : "la", "family" : "itc", "otherNames" : , "categoryName" : "Romance languages"}

local tests = require("Module:UnitTests")

local getByCode = require("Module:families").getByCode

local families = {}
setmetatable(families, { -- Auto-create family objects: families.roa -> family object for Romance.
	__index = function(self, key)
		local family = getByCode(key) or error("No language with code " .. key .. ".")
		self = family
		return family
	end
})

function tests:test_getCanonicalName()
	local examples = {
		{"roa", "Romance"},
		{"gem", "Germanic"},
	}

	self:iterate(examples, function(self, code, expected)
		self:equals(code, families:getCanonicalName(), expected)
	end)
end

function tests:test_makeWikipediaLink()
	local examples = {
		{"roa", "]"},
		{"gem", "]"},
		{"sgn-jsl", "]"},
	}
	
	self:iterate(examples, function(self, code, expected)
		self:equals(code, families:makeWikipediaLink(), expected, {nowiki=1})
	end)
end

function tests:test_getWikidataItem()
	local examples = {
		{"roa", "Q19814"},
		{"gem", "Q21200"},
	}

	self:iterate(examples, function(self, code, expected)
		self:equals(code, families:getWikidataItem(), expected)
	end)
end

function tests:test_toJSON()
	self:equals('roa-JSON', families.roa:toJSON(), , "categoryName" : "Romance languages", "family" : "itc"}]])
end

return tests