summaryrefslogtreecommitdiff
path: root/test/test_ipaddr.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-06-04 18:58:15 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-10-07 18:22:43 +0900
commitabad5e10e80c06f2e756667cd2d7f7d9b6e78ba5 (patch)
tree687de1ead6d36c1020fa3349fbad7d7112d77105 /test/test_ipaddr.rb
parent38da84296c0e50c4285d8a8c146af5fc3c8afc7d (diff)
[ruby/ipaddr] Disallow leading zeros in mask
https://github.com/ruby/ipaddr/commit/f49d2d49a4
Diffstat (limited to 'test/test_ipaddr.rb')
-rw-r--r--test/test_ipaddr.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test_ipaddr.rb b/test/test_ipaddr.rb
index 3c3d70e3f2..2b6e5c7524 100644
--- a/test/test_ipaddr.rb
+++ b/test/test_ipaddr.rb
@@ -92,6 +92,8 @@ class TC_IPAddr < Test::Unit::TestCase
assert_raise(IPAddr::InvalidAddressError) { IPAddr.new("[2001:200:300::]\nINVALID") }
assert_raise(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.1/32\nINVALID") }
assert_raise(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.1/32/20") }
+ assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("192.168.0.1/032") }
+ assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("::1/0128") }
assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("::1/255.255.255.0") }
assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("::1/129") }
assert_raise(IPAddr::InvalidPrefixError) { IPAddr.new("192.168.0.1/33") }