diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_gc.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 39716eb7e2..9fb9550147 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -118,4 +118,20 @@ class TestGc < Test::Unit::TestCase ensure GC::Profiler.disable end + + def test_profiler_clear + GC::Profiler.enable + + GC.start + assert_equal(1, GC::Profiler.raw_data.size) + GC.clear + assert_equal(0, GC::Profiler.raw_data.size) + + 200.times{ GC.start } + assert_equal(200, GC::Profiler.raw_data.size) + GC.clear + assert_equal(0, GC::Profiler.raw_data.size) + ensure + GC::Profiler.disable + end end |