From 5e580a48a930fff71bcfded65616dcfd9c17e19c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 6 Jun 2011 19:23:35 -0700 Subject: test_ipv6: improve tests for ipv6 We need to ensure IPv4-mapped-IPv6 addresses work. --- test/test_ipv6.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-24-ge0c7