diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-30 00:58:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-30 00:58:58 +0000 |
commit | b873dfc6a21a25d03c2435bed2973c680b1a83a9 (patch) | |
tree | 9e1346e210b1e2b33378b9de39f805cf6a44d2f3 /test | |
parent | a7a11f078ef1f45f51f8f48c1d091986fe14a8a8 (diff) | |
download | ruby-b873dfc6a21a25d03c2435bed2973c680b1a83a9.tar.gz |
object.c: fix prepend cmp
* object.c (rb_class_inherited_p): search the corresponding
ancestor to prepended module from prepending class itself.
[ruby-core:72493] [Bug #11878]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_module.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 55678e42a8..6b7c0da4a2 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1566,6 +1566,12 @@ class TestModule < Test::Unit::TestCase end end + def test_prepend_CMP + bug11878 = '[ruby-core:72493] [Bug #11878]' + assert_equal(-1, C1 <=> M2) + assert_equal(+1, M2 <=> C1, bug11878) + end + def test_prepend_inheritance bug6654 = '[ruby-core:45914]' a = labeled_module("a") |