From f3c77bd480834f2835fe6fef5c0475336248dbde Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 17 Jan 2022 01:56:31 +0900 Subject: Fix the placeholder subclass entry skipping [Bug #18489] --- test/ruby/test_module.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 0a6959c5e6..e744121718 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -475,6 +475,15 @@ class TestModule < Test::Unit::TestCase assert_not_include(mod.ancestor_list, BasicObject) end + def test_module_collected_extended_object + m1 = labeled_module("m1") + m2 = labeled_module("m2") + Object.new.extend(m1) + GC.start + m1.include(m2) + assert_equal([m1, m2], m1.ancestors) + end + def test_dup OtherSetup.call -- cgit v1.2.3