From f99bc2c10eb4a911e8382377bbd2fb8b3882e687 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 5 Jun 2008 14:57:05 +0000 Subject: * test/ruby/test_gc.rb: add tests to achieve over 90% test coverage of gc.c. * test/ruby/test_objectspace.rb: ditto. * test/ruby/test_marshal.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/ruby/test_gc.rb') diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 72c38e4b2..42b249d0d 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -32,4 +32,23 @@ class TestGc < Test::Unit::TestCase GC.stress = prev_stress end + + def test_enable_disable + GC.enable + assert_equal(false, GC.enable) + assert_equal(false, GC.disable) + assert_equal(true, GC.disable) + assert_equal(true, GC.disable) + assert_nil(GC.start) + assert_equal(true, GC.enable) + assert_equal(false, GC.enable) + ensure + GC.enable + end + + def test_count + c = GC.count + GC.start + assert_operator(c, :<, GC.count) + end end -- cgit