diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-14 01:38:12 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-14 01:38:12 +0000 |
commit | 1e7ef5882e18b318f68804aada885eee47045593 (patch) | |
tree | c19c75e884324aed7c7607691798c59329ecc0af /test/objspace/test_objspace.rb | |
parent | bc2195e4fbf7281af3a0bd055d4263690d7aad9f (diff) | |
download | ruby-1e7ef5882e18b318f68804aada885eee47045593.tar.gz |
Use assert_separately to speed up slow tests
These speed will slow down when there are many objects like test-all.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/objspace/test_objspace.rb')
-rw-r--r-- | test/objspace/test_objspace.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index eeb8ffa664..136f7e8318 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -70,6 +70,7 @@ class TestObjSpace < Test::Unit::TestCase end def test_reachable_objects_from + assert_separately %w[--disable-gem -robjspace], __FILE__, __LINE__, <<-'eom' assert_equal(nil, ObjectSpace.reachable_objects_from(nil)) assert_equal([Array, 'a', 'b', 'c'], ObjectSpace.reachable_objects_from(['a', 'b', 'c'])) @@ -91,9 +92,11 @@ class TestObjSpace < Test::Unit::TestCase end } assert_operator(max, :>=, 1_001, "1000 elems + Array class") + eom end def test_reachable_objects_size + assert_separately %w[--disable-gem -robjspace], __FILE__, __LINE__, <<-'eom' ObjectSpace.each_object{|o| ObjectSpace.reachable_objects_from(o).each{|reached_obj| size = ObjectSpace.memsize_of(reached_obj) @@ -101,5 +104,6 @@ class TestObjSpace < Test::Unit::TestCase assert_operator(size, :>=, 0) } } + eom end end |