diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-21 19:04:56 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-21 19:04:56 +0000 |
commit | 50860e6eca115bf2dcf30f0ce3e03f0463eb3efd (patch) | |
tree | f1f27fb1b9ca64715d5953cc8178451e2ca74c7d /test | |
parent | 06f5c93b2e7c06b492cbf720336bc10495e47628 (diff) | |
download | ruby-50860e6eca115bf2dcf30f0ce3e03f0463eb3efd.tar.gz |
* 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.rb | 16 |
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 |