From 492d120877e6687fa27d68c3bb17f776d14340fc Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 27 Oct 2010 19:02:24 +0000 Subject: * gc.c (GC.stat): added. [ruby-dev:38607] * test/ruby/test_gc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 1bd3df4c1a..039240f1e0 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -51,4 +51,16 @@ class TestGc < Test::Unit::TestCase GC.start assert_operator(c, :<, GC.count) end + + def test_stat + res = GC.stat + assert_equal(false, res.empty?) + assert_kind_of(Integer, res[:count]) + + arg = Hash.new + res = GC.stat(arg) + assert_equal(arg, res) + assert_equal(false, res.empty?) + assert_kind_of(Integer, res[:count]) + end end -- cgit v1.2.3