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 06:49, 8 October 2018 (use the _exportFunctions function). 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()

mBlockTextFunctions = mBlockText._exportFunctions()
parsePageName = mBlockTextFunctions.parsePageName

function suite:test_parse_special_block_with_ipv4_address()
	self:assertEquals(
		parsePageName('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