Jump to content

Module:IPAddress/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dcoetzee (talk | contribs) at 02:55, 6 March 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:IPAddress]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_isIp()
    self:preprocess_equals_many('{{#invoke:IPAddress|isIp|', '}}', {
        {'200.200.200.200', '1'},
        {'200.200.256.200', '0'},
        {'200.200.200.200.', '0'},
        {'200.200.200', '0'},
        {'200.200.200.2d0', '0'},
        {'AB:02:3008:8CFD:AB:02:3008:8CFD', '1'},
    })
end

return p