зеркало из https://github.com/github/ruby.git
* string.c (rb_str_comparable): string comparison should be
transitive. [ruby-dev:36484] * test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_eq): test updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
2de01f01a7
Коммит
f2f2cd5bc6
|
@ -1,3 +1,11 @@
|
|||
Mon Oct 6 12:18:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_comparable): string comparison should be
|
||||
transitive. [ruby-dev:36484]
|
||||
|
||||
* test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_eq): test
|
||||
updated.
|
||||
|
||||
Mon Oct 6 09:00:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): test
|
||||
|
|
3
string.c
3
string.c
|
@ -1938,7 +1938,6 @@ rb_str_comparable(VALUE str1, VALUE str2)
|
|||
{
|
||||
int idx1, idx2;
|
||||
int rc1, rc2;
|
||||
int a8;
|
||||
|
||||
if (RSTRING_LEN(str1) == 0) return Qtrue;
|
||||
if (RSTRING_LEN(str2) == 0) return Qtrue;
|
||||
|
@ -1956,8 +1955,6 @@ rb_str_comparable(VALUE str1, VALUE str2)
|
|||
if (rb_enc_asciicompat(rb_enc_from_index(idx1)))
|
||||
return Qtrue;
|
||||
}
|
||||
a8 = rb_ascii8bit_encindex();
|
||||
if (idx1 == a8 || idx2 == a8) return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
|
|
|
@ -320,9 +320,7 @@ class TestM17NComb < Test::Unit::TestCase
|
|||
desc_eq = "#{encdump s1} == #{encdump s2}"
|
||||
if a(s1) == a(s2) and
|
||||
(s1.ascii_only? && s2.ascii_only? or
|
||||
s1.encoding == s2.encoding or
|
||||
s1.encoding == (enc = Encoding.find("ASCII-8BIT")) or
|
||||
s2.encoding == enc) then
|
||||
s1.encoding == s2.encoding) then
|
||||
assert(s1 == s2, desc_eq)
|
||||
assert(!(s1 != s2))
|
||||
assert_equal(0, s1 <=> s2)
|
||||
|
|
Загрузка…
Ссылка в новой задаче