summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-12-20 08:26:14 -0800
committerJeremy Evans <code@jeremyevans.net>2021-12-20 11:02:15 -0800
commit3bd5f27f737c7d365b7d01c43d77a958c224ab16 (patch)
tree2e3933d29fc01a17999c3664969017df77a998a0 /test/ruby
parentc57ac4c6e0acf9b4c1fbb3092eefc89873c5d249 (diff)
Remove Class#descendants
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5309
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_class.rb32
1 files changed, 0 insertions, 32 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 28285705bf..07c34ce9d5 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -738,38 +738,6 @@ class TestClass < Test::Unit::TestCase
assert_same(c, Module.new.const_set(:Foo, c))
end
- def test_descendants
- c = Class.new
- sc = Class.new(c)
- ssc = Class.new(sc)
- [c, sc, ssc].each do |k|
- k.include Module.new
- k.new.define_singleton_method(:force_singleton_class){}
- end
- assert_equal([sc, ssc], c.descendants)
- assert_equal([ssc], sc.descendants)
- assert_equal([], ssc.descendants)
-
- object_descendants = Object.descendants
- assert_include(object_descendants, c)
- assert_include(object_descendants, sc)
- assert_include(object_descendants, ssc)
- end
-
- def test_descendants_gc
- c = Class.new
- 100000.times { Class.new(c) }
- assert(c.descendants.size <= 100000)
- end
-
- def test_descendants_gc_stress
- 10000.times do
- c = Class.new
- 100.times { Class.new(c) }
- assert(c.descendants.size <= 100)
- end
- end
-
def test_subclasses
c = Class.new
sc = Class.new(c)