summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 19:04:56 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 19:04:56 +0000
commit46215c1e90183952be55bead4c04cc8b6a8b8ee5 (patch)
treef1f27fb1b9ca64715d5953cc8178451e2ca74c7d /test
parent0fceffce7e422bfd3bba70ba8535f2967473c682 (diff)
* gc.c (internal_object_p): Now a singleton classes appear by
ObjectSpace.each_object. [Bug #11360] * test/ruby/test_objectspace.rb: add a test about it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_objectspace.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_objectspace.rb b/test/ruby/test_objectspace.rb
index d519041f0b..a57c7ea1d1 100644
--- a/test/ruby/test_objectspace.rb
+++ b/test/ruby/test_objectspace.rb
@@ -109,4 +109,20 @@ End
p Thread.current[:__recursive_key__]
end;
end
+
+ def test_each_object_singleton_class
+ assert_separately([], <<-End)
+ class C
+ class << self
+ $c = self
+ end
+ end
+
+ exist = false
+ ObjectSpace.each_object(Class){|o|
+ exist = true if $c == o
+ }
+ assert(exist, 'Bug #11360')
+ End
+ end
end