diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-22 09:53:35 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-22 09:53:35 +0000 |
commit | 776b8b1fd1932221621b85e0a3176cc69ebb0647 (patch) | |
tree | 7e3d7b854428b0f18542412f8be1dae2897d3445 /test/ruby/test_module.rb | |
parent | d2164fc5f2c8d32aaa9a857ca680c8f6d05ed106 (diff) |
merge revision(s) 45076: [Backport #9535]
* class.c (rb_mod_init_copy): do nothing if copying self.
[ruby-dev:47989] [Bug #9535]
* hash.c (rb_hash_initialize_copy): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index ba6f273159..f89071c10f 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -364,6 +364,17 @@ class TestModule < Test::Unit::TestCase assert_equal([:MIXIN, :USER], User.constants.sort) end + def test_self_initialize_copy + bug9535 = '[ruby-dev:47989] [Bug #9535]' + m = Module.new do + def foo + :ok + end + initialize_copy(self) + end + assert_equal(:ok, Object.new.extend(m).foo, bug9535) + end + def test_dup bug6454 = '[ruby-core:45132]' |