summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-02 10:54:39 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-02 10:54:39 +0000
commitb2a4cea3b95d89b8cb42df5fb269fc687ca19abe (patch)
tree089ba7afccf3bbac5ce3b78be0ab27ba5a3f3e0b /test
parenta1692f7fdf62dc109886d9910b4dcca635dc2e25 (diff)
Modules should not have subclasses.
When refining a module, the module was set to the superclass of its refinement, and a segmentation fault occurred. The superclass of the refinement should be an iclass of the module. [ruby-core:83617] [Bug #14070] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index d489404fff..3aab6e4f1e 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -2036,6 +2036,25 @@ class TestRefinement < Test::Unit::TestCase
INPUT
end
+ def test_refining_module_repeatedly
+ bug14070 = '[ruby-core:83617] [Bug #14070]'
+ assert_in_out_err([], <<-INPUT, ["ok"], [], bug14070)
+ 1000.times do
+ Class.new do
+ include Enumerable
+ end
+
+ Module.new do
+ refine Enumerable do
+ def foo
+ end
+ end
+ end
+ end
+ puts "ok"
+ INPUT
+ end
+
private
def eval_using(mod, s)