summaryrefslogtreecommitdiff
path: root/test/objspace/test_objspace.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-17 23:56:37 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-17 23:56:37 +0000
commit05561ad75c4e3e7b1cb2615f51683aa8478e7540 (patch)
treef82f09b2949c458a47c05d889b3ca68dde200dd1 /test/objspace/test_objspace.rb
parentdf33c063fccf1bca9e7d67140b2950e1b434d9b4 (diff)
ext/objspace/objspace.c: remove unneeded code clones.
`setup_hash` have already performed nil check and empty check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/objspace/test_objspace.rb')
-rw-r--r--test/objspace/test_objspace.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index c5c8147f5f..9c706f2736 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -61,9 +61,19 @@ class TestObjSpace < Test::Unit::TestCase
res = ObjectSpace.count_objects_size
assert_not_empty(res)
assert_operator(res[:TOTAL], :>, 0)
+ end
+
+ def test_count_objects_size_with_hash
arg = {}
ObjectSpace.count_objects_size(arg)
assert_not_empty(arg)
+ arg = {:TOTAL => 1 }
+ ObjectSpace.count_objects_size(arg)
+ assert_not_empty(arg)
+ end
+
+ def test_count_objects_size_with_wrong_type
+ assert_raise(TypeError) { ObjectSpace.count_objects_size(0) }
end
def test_count_nodes