summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ipaddress/ipv6_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ipaddress/ipv6_test.rb b/test/ipaddress/ipv6_test.rb
index e29cd40..cfff9e7 100644
--- a/test/ipaddress/ipv6_test.rb
+++ b/test/ipaddress/ipv6_test.rb
@@ -58,6 +58,22 @@ class IPv6Test < Minitest::Test
"ff80:03:02:01::",
"2001:db8::8:800:200c:417a",
"fe80::/63"]
+
+ @unique_local = [
+ "fc00::/7",
+ "fc00::/8",
+ "fd00::/8",
+ "fd12:3456:789a:1::1",
+ "fd12:3456:789a:1::/64",
+ "fc00::1"]
+
+ @not_unique_local = [
+ "fc00::/6",
+ "::",
+ "::1",
+ "fe80::",
+ "fe80::1",
+ "fe80::/64"]
end
@@ -240,6 +256,15 @@ class IPv6Test < Minitest::Test
end
end
+ def test_method_unique_local?
+ @unique_local.each do |addr|
+ assert_equal true, @klass.new(addr).unique_local?
+ end
+ @not_unique_local.each do |addr|
+ assert_equal false, @klass.new(addr).unique_local?
+ end
+ end
+
def test_method_network
@networks.each do |addr,net|
ip = @klass.new addr