summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbluemonk <ceresa@gmail.com>2011-03-29 10:28:20 +0200
committerbluemonk <ceresa@gmail.com>2011-03-29 10:28:20 +0200
commit485f51cd8314988149acd2f4705d24ed4ce3f90f (patch)
treed965f91412fa7103a6b1de7f78eea31784dd1dbb /test
parentf34b5cdf6ca6c49042d02f09c6dc33f47f1718be (diff)
downloadipaddress-485f51cd8314988149acd2f4705d24ed4ce3f90f.tar.gz
Added a few more tests for IPv4::summarize
Diffstat (limited to 'test')
-rw-r--r--test/ipaddress/ipv4_test.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/ipaddress/ipv4_test.rb b/test/ipaddress/ipv4_test.rb
index d983543..8cb3b8f 100644
--- a/test/ipaddress/ipv4_test.rb
+++ b/test/ipaddress/ipv4_test.rb
@@ -472,12 +472,21 @@ class IPv4Test < Test::Unit::TestCase
result = ["10.0.1.0/24","10.10.2.0/24","172.16.0.0/23"]
assert_equal result, @klass.summarize(ip1,ip2,ip3,ip4).map{|i| i.to_string}
- ips = [
- @klass.new("10.0.0.12/30"),
- @klass.new("10.0.100.0/24")
- ]
+ ips = [@klass.new("10.0.0.12/30"),
+ @klass.new("10.0.100.0/24")]
result = ["10.0.0.12/30", "10.0.100.0/24"]
assert_equal result, @klass.summarize(*ips).map{|i| i.to_string}
+
+ ips = [@klass.new("172.16.0.0/31"),
+ @klass.new("10.10.2.1/32")]
+ result = ["10.10.2.1/32", "172.16.0.0/31"]
+ assert_equal result, @klass.summarize(*ips).map{|i| i.to_string}
+
+ ips = [@klass.new("172.16.0.0/32"),
+ @klass.new("10.10.2.1/32")]
+ result = ["10.10.2.1/32", "172.16.0.0/32"]
+ assert_equal result, @klass.summarize(*ips).map{|i| i.to_string}
+
end
def test_classmethod_parse_data