about summary refs log tree commit
path: root/test/test_gc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_gc.rb')
-rw-r--r--test/test_gc.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/test_gc.rb b/test/test_gc.rb
index 5829deb..316d355 100644
--- a/test/test_gc.rb
+++ b/test/test_gc.rb
@@ -15,9 +15,20 @@ class TestGc < Test::Unit::TestCase
     @strings.add('127.0.0.0/24', "localhost")
   end
 
+  def test_gc_dup
+    100000.times do
+      tmp = @strings.dup
+      tmp.remove '127.0.0.0/24'
+      tmp = @arrays.dup
+      tmp.remove '127.0.0.0/24'
+    end
+    assert_equal [], @arrays.match_best('127.0.0.1').data
+    assert_equal "localhost", @strings.match_best('127.0.0.1').data
+  end
+
   def test_gc
     assert_nothing_raised do
-      5_000_000.times do
+      500_000.times do
         t = Patricia.new
         t.add('10.0.0.0/8', {})
         t.add('127.0.0.0/24', "home sweet home")
@@ -25,7 +36,7 @@ class TestGc < Test::Unit::TestCase
     end
 
     # ensure what we created originally didn't get GC-ed'
-    5_000_000.times do
+    500_000.times do
       assert_equal [], @arrays.match_best('127.0.0.1').data
       assert_equal "localhost", @strings.match_best('127.0.0.1').data
     end