summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_gc.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index a05da28f7e..9029f2bda8 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -856,6 +856,16 @@ class TestGc < Test::Unit::TestCase
ensure
GC.enable unless disabled
end
+
+ begin
+ disabled = GC.disable
+ c = GC.count
+ GC.start(immediate_mark: false, immediate_sweep: false)
+ 10_000.times { Object.new }
+ assert_equal 1, GC.count - c
+ ensure
+ GC.enable unless disabled
+ end
end
def test_vm_object