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:
nobu 2012-11-30 08:43:42 +00:00
parent 981f9c52c6
commit 1dbc720c0d
3 changed files with 16 additions and 7 deletions

View file

@ -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 # '=='