mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
string.c: always fixed value
* string.c (rb_str_cmp_m): return fixed value, one of -1,0,+1 always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
981f9c52c6
commit
1dbc720c0d
3 changed files with 16 additions and 7 deletions
|
@ -181,7 +181,7 @@ class TestString < Test::Unit::TestCase
|
|||
|
||||
class << o;remove_method :<=>;end
|
||||
def o.<=>(x); 2**100; end
|
||||
assert_equal(-(2**100), "foo" <=> o)
|
||||
assert_equal(-1, "foo" <=> o)
|
||||
end
|
||||
|
||||
def test_EQUAL # '=='
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue