diff options
author | Mike Mackintosh <m@zyp.io> | 2015-03-22 22:32:33 -0400 |
---|---|---|
committer | Mike Mackintosh <m@zyp.io> | 2015-03-22 22:32:33 -0400 |
commit | 09bde2a5ef66884ab63f8649a15514840c03dd83 (patch) | |
tree | 38ad2e128b89efc30bb3f3d91df691a00356a022 /test | |
parent | f562a7f7a032b381cdc8b897ec50ed220bcc9452 (diff) | |
download | ipaddress-09bde2a5ef66884ab63f8649a15514840c03dd83.tar.gz |
added bugfix/40 fix with test
Diffstat (limited to 'test')
-rw-r--r-- | test/ipaddress/ipv4_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ipaddress/ipv4_test.rb b/test/ipaddress/ipv4_test.rb index bf969ad..e0b37b8 100644 --- a/test/ipaddress/ipv4_test.rb +++ b/test/ipaddress/ipv4_test.rb @@ -542,6 +542,15 @@ class IPv4Test < Minitest::Test assert_raises(ArgumentError){ @klass.parse_classful("192.168.256.257") } end + def test_network_split + @classful.each do |ip,net| + x = @klass.new("#{ip}/#{net}") + assert_equal x.split(1).length, 1 + assert_equal x.split(2).length, 2 + assert_equal x.split(32).length, 32 + assert_equal x.split(256).length, 256 + end + end end # class IPv4Test |