summaryrefslogtreecommitdiff
path: root/test/ruby/test_comparable.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-17 11:55:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-17 11:55:50 +0000
commit44c5c2a3120439af7560f9694dcb117953ee3119 (patch)
tree01373760110357e230e5aa20914bbf8479b5db4f /test/ruby/test_comparable.rb
parentc9283b5c5dd1253bbfa340b34e40dcd57da377db (diff)
compar.c: inversed comarison without infinite recursion
* 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/trunk@39292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_comparable.rb')
-rw-r--r--test/ruby/test_comparable.rb7
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