about summary refs log tree commit
path: root/test/test_ipv6.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_ipv6.rb')
-rw-r--r--test/test_ipv6.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_ipv6.rb b/test/test_ipv6.rb
new file mode 100644
index 0000000..7bf95c2
--- /dev/null
+++ b/test/test_ipv6.rb
@@ -0,0 +1,13 @@
+require 'test/unit'
+require 'rpatricia'
+
+class TestIPv6 < Test::Unit::TestCase
+  def test_ipv6
+    t = Patricia.new :AF_INET6
+    assert_equal :AF_INET6, t.family
+    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
+  end
+end