Module:Sensitive IP addresses/API: Difference between revisions

Content deleted Content added
m use "test" rather than "ips", as there could be subnets as well
test getRanges to show IP ranges equivalent to collection
Line 115:
-- }
-- }
 
--------------------------------------------------------------------------------
-- Q&D demo of loading data from [[Module:Sensitive IP addresses/list]]
Line 213:
-- Run test using Module:IP
----------------------------------------------------------------------------
local results = Collection.new()
local data = loadList('Module:Sensitive IP addresses/list')
local results = Collection.new()
results:add('IP ranges equivalent to collection')
for _, col in ipairs({data.v4Collection, data.v6Collection}) do
for _, range in ipairs(col:getRanges()) do
if range[1] == range[2] then
results:add(' ' .. range[1])
else
results:add(' ' .. range[1] .. ' – ' .. range[2])
end
end
end
for _, ipStr in ipairs({
-- Each of the following is tested against the sensitive list.