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:28, 6 March 2013 (Initial tests based on User:Jfd34/sandbox). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- Unit tests for [[Module:IPAddress]]. Click talk page to run tests.
local p = require('Module:IPAddress')

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

return p