Jump to content

Module:Sensitive IP addresses/blocktext/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 07:06, 8 October 2018 (actually pass a title object in to parseTitle). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:Sensitive IP addresses/blocktext]]

local mBlockText = require('Module:Sensitive IP addresses/blocktext')
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

local mBlockTextFunctions = mBlockText._exportFunctions()
local parseTitle = mBlockTextFunctions.parseTitle

function suite:test_parse_special_block_with_ipv4_address()
	self:assertEquals(
		parseTitle(mw.title.new('Special:Block/1.2.3.4')),
		'1.2.3.4',
		"'Special:Block/1.2.3.4' parsed as '1.2.3.4'"
	)
end

return suite