summaryrefslogtreecommitdiff
path: root/test/objspace/test_objspace.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/objspace/test_objspace.rb')
-rw-r--r--test/objspace/test_objspace.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index ceb9650b6e5..04a33817de7 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -19,8 +19,13 @@ class TestObjSpace < Test::Unit::TestCase
assert_kind_of(Integer, ObjectSpace.memsize_of(Struct.new(:a)))
end
- def test_total_memsize_of_all_objects
- assert_kind_of(Integer, ObjectSpace.total_memsize_of_all_objects)
+ def test_memsize_of_all
+ assert_kind_of(Integer, a = ObjectSpace.memsize_of_all)
+ assert_kind_of(Integer, b = ObjectSpace.memsize_of_all(String))
+ assert(a > b)
+ assert(a > 0)
+ assert(b > 0)
+ assert_raise(TypeError) {ObjectSpace.memsize_of_all('error')}
end
def test_count_objects_size