about summary refs log tree commit
diff options
context:
space:
mode:
-rw-r--r--test/test_ipv6.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test_ipv6.rb b/test/test_ipv6.rb
index 7bf95c2..f16ab65 100644
--- a/test/test_ipv6.rb
+++ b/test/test_ipv6.rb
@@ -8,6 +8,15 @@ class TestIPv6 < Test::Unit::TestCase
     node = t.add('1234:567::/35', 'hello world')
     assert_kind_of Patricia::Node, node
     assert_equal 'hello world', node.data
-    t.match_best('1234:567::/128').data
+    assert_equal 'hello world', t.match_best('1234:567::/128').data
+  end
+
+  def test_ipv4_mapped_ipv6
+    t = Patricia.new :AF_INET6
+    assert_equal :AF_INET6, t.family
+    node = t.add('::ffff:10.0.0.0/8', 'hello world')
+    assert_kind_of Patricia::Node, node
+    assert_equal 'hello world', node.data
+    assert_equal 'hello world', t.match_best('::ffff:10.0.0.1').data
   end
 end