summaryrefslogtreecommitdiff
path: root/test/ruby/test_gc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_gc.rb')
-rw-r--r--test/ruby/test_gc.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 1511ea3011..f42e098863 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -461,4 +461,12 @@ class TestGc < Test::Unit::TestCase
skip "finalizers did not get run" if @result.empty?
assert_equal([:c1, :c2], @result)
end
+
+ def test_object_ids_never_repeat
+ GC.start
+ a = 1000.times.map { Object.new.object_id }
+ GC.start
+ b = 1000.times.map { Object.new.object_id }
+ assert_empty(a & b)
+ end
end