Module:PropertyChain/testcases

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Lua

CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules

✘[No] 1 test failed.

Name Expected Actual
✘[No] test_P131_chain [[w:en:Lakes, Cumbria|<span title="civil parish in Cumbria, UK">Lakes</span>]]->[[w:en:South Lakeland|<span title="local government district in Cumbria, England">South Lakeland</span>]]->[[w:en:Cumbria|<span title="ceremonial county of England">Cumbria</span>]]->[[w:en:North West England|<span title="region of England">North West England</span>]]->[[w:en:England|<span title="country in north-west Europe, part of the United Kingdom">England</span>]]->[[w:en:United Kingdom|<span title="country in north-west Europe">United Kingdom</span>]] [[w:en:Lakes, Cumbria|<span title="civil parish in Cumbria, UK">Lakes</span>]]->[[w:en:South Lakeland|<span title="former local government district in Cumbria, England">South Lakeland</span>]]->[[w:en:Cumbria|<span title="ceremonial county of England">Cumbria</span>]]->[[w:en:North West England|<span title="region of England">North West England</span>]]->[[w:en:England|<span title="country in north-west Europe, part of the United Kingdom">England</span>]]->[[w:en:United Kingdom|<span title="country in north-west Europe">United Kingdom</span>]]

Code

local PropertyChain = require('Module:PropertyChain')._PropertyChain-- the module to be tested
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

function suite:test_P131_chain()
	local arr = {
		'[[w:en:Lakes, Cumbria|<span title="civil parish in Cumbria, UK">Lakes</span>]]',
		'[[w:en:South Lakeland|<span title="local government district in Cumbria, England">South Lakeland</span>]]',
		'[[w:en:Cumbria|<span title="ceremonial county of England">Cumbria</span>]]',
		'[[w:en:North West England|<span title="region of England">North West England</span>]]',
		'[[w:en:England|<span title="country in north-west Europe, part of the United Kingdom">England</span>]]',
		'[[w:en:United Kingdom|<span title="country in north-west Europe">United Kingdom</span>]]'
	}
	self:assertEquals( table.concat(arr,'->'), PropertyChain('Q2510182', 'P131', nil, 'wikipedia', '->', 'en'))
end

return suite