Skip to content
Snippets Groups Projects
Commit 5a089bda authored by Michael Miller's avatar Michael Miller Committed by Romain Tartière
Browse files

Add tests for unique_local?

parent f131450c
Branches
No related tags found
No related merge requests found
...@@ -58,6 +58,22 @@ class IPv6Test < Minitest::Test ...@@ -58,6 +58,22 @@ class IPv6Test < Minitest::Test
"ff80:03:02:01::", "ff80:03:02:01::",
"2001:db8::8:800:200c:417a", "2001:db8::8:800:200c:417a",
"fe80::/63"] "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 end
...@@ -240,6 +256,15 @@ class IPv6Test < Minitest::Test ...@@ -240,6 +256,15 @@ class IPv6Test < Minitest::Test
end end
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 def test_method_network
@networks.each do |addr,net| @networks.each do |addr,net|
ip = @klass.new addr ip = @klass.new addr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment