diff options
Diffstat (limited to 'test/inet.lua')
-rw-r--r-- | test/inet.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/inet.lua b/test/inet.lua index 26d05e3..dd90fef 100644 --- a/test/inet.lua +++ b/test/inet.lua @@ -288,6 +288,14 @@ local function misc() assert(inet.is(inet('::'))) assert(inet.version == 1) + + -- check out of bounds handling + assert(inet('0.0.0.0') - 1 == nil) + assert(inet('255.255.255.255') + 1 == nil) + assert(inet('::') - 1 == nil) + assert(inet('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff') + 1 == nil) + assert(inet('0.0.0.0/24') * -1 == nil) + assert(inet('255.255.255.0/24') * 1 == nil) end local t = test.new() |