ruby-changes:8168
From: matz <ko1@a...>
Date: Mon, 6 Oct 2008 12:23:54 +0900 (JST)
Subject: [ruby-changes:8168] Ruby:r19696 (trunk): * string.c (rb_str_comparable): string comparison should be
matz 2008-10-06 12:22:56 +0900 (Mon, 06 Oct 2008) New Revision: 19696 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19696 Log: * 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. Modified files: trunk/ChangeLog trunk/string.c trunk/test/ruby/test_m17n_comb.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 19695) +++ ChangeLog (revision 19696) @@ -1,3 +1,11 @@ +Mon Oct 6 12:18:23 2008 Yukihiro Matsumoto <matz@r...> + + * 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@r...> * test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): test Index: string.c =================================================================== --- string.c (revision 19695) +++ string.c (revision 19696) @@ -1938,7 +1938,6 @@ { 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 @@ if (rb_enc_asciicompat(rb_enc_from_index(idx1))) return Qtrue; } - a8 = rb_ascii8bit_encindex(); - if (idx1 == a8 || idx2 == a8) return Qtrue; return Qfalse; } Index: test/ruby/test_m17n_comb.rb =================================================================== --- test/ruby/test_m17n_comb.rb (revision 19695) +++ test/ruby/test_m17n_comb.rb (revision 19696) @@ -320,9 +320,7 @@ 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/