diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-19 23:57:11 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-19 23:57:11 +0000 |
commit | 0558cc52725888379bf7ba1c81f37a31921df081 (patch) | |
tree | 6e8dbb276530cf65469432215b3bcc4059f76c9f /test | |
parent | 855f97202af9c55307a19c45c4a8d95cfb7d99d0 (diff) |
Merge revision 39292:
* compar.c (rb_invcmp): compare by inversed comarison, with preventing
from infinite recursion. [ruby-core:52305] [Bug #7870]
* string.c (rb_str_cmp_m), time.c (time_cmp): get rid of infinite
recursion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_comparable.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_comparable.rb b/test/ruby/test_comparable.rb index 00ce6b485a..c686adeceb 100644 --- a/test/ruby/test_comparable.rb +++ b/test/ruby/test_comparable.rb @@ -69,4 +69,11 @@ class TestComparable < Test::Unit::TestCase assert_raise(ArgumentError) { 1.0 < nil } assert_raise(ArgumentError) { 1.0 < Object.new } end + + def test_inversed_compare + bug7870 = '[ruby-core:52305] [Bug #7870]' + assert_nothing_raised(SystemStackError, bug7870) { + assert_nil(Time.new <=> "") + } + end end |