From 121b6e064a1b167dddbdc271d503ff96e7deb83b Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 19 Nov 2015 12:57:20 +0000 Subject: * gc.c (gc_start): force to invoke GC by GC.start even if it is GC.disable'd. * test/ruby/test_gc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby/test_gc.rb') diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 0ed592b285..ff0696bce5 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -385,4 +385,15 @@ class TestGc < Test::Unit::TestCase C.new end; end + + def test_gc_disabled_start + begin + disabled = GC.disable + c = GC.count + GC.start + assert_equal 1, GC.count - c + ensure + GC.enable unless disabled + end + end end -- cgit v1.2.3