ruby-changes:2660
From: ko1@a...
Date: 9 Dec 2007 12:12:50 +0900
Subject: [ruby-changes:2660] nobu - Ruby:r14151 (trunk): * string.c (tr_find): returns true if no characters to be removed is
nobu 2007-12-09 12:12:25 +0900 (Sun, 09 Dec 2007) New Revision: 14151 Modified files: trunk/ChangeLog trunk/bootstraptest/test_knownbug.rb trunk/string.c trunk/test/ruby/test_m17n.rb Log: * string.c (tr_find): returns true if no characters to be removed is specified. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=14151&r2=14150 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14151&r2=14150 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=14151&r2=14150 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_knownbug.rb?r1=14151&r2=14150 Index: ChangeLog =================================================================== --- ChangeLog (revision 14150) +++ ChangeLog (revision 14151) @@ -1,3 +1,8 @@ +Sun Dec 9 12:12:23 2007 Nobuyoshi Nakada <nobu@r...> + + * string.c (tr_find): returns true if no characters to be removed is + specified. + Sun Dec 9 12:03:16 2007 Nobuyoshi Nakada <nobu@r...> * parse.y (parser_magic_comment): delimits with a semicolon. Index: bootstraptest/test_knownbug.rb =================================================================== --- bootstraptest/test_knownbug.rb (revision 14150) +++ bootstraptest/test_knownbug.rb (revision 14151) @@ -156,9 +156,4 @@ "\xa3\xb0".force_encoding("euc-jp"), "\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") ] -} - -assert_equal 'true', %q{ - s = "\xa3\xb0\xa3\xb1\xa3\xb1\xa3\xb3\xa3\xb4".force_encoding("euc-jp") - s.squeeze == "\xa3\xb0\xa3\xb1\xa3\xb3\xa3\xb4".force_encoding("euc-jp") -} +}, '[ruby-dev:32452]' Index: string.c =================================================================== --- string.c (revision 14150) +++ string.c (revision 14151) @@ -3674,8 +3674,8 @@ else { VALUE v = INT2NUM(c); - if ((del && !NIL_P(rb_hash_aref(del, v))) && - (!nodel || NIL_P(rb_hash_aref(nodel, v)))) { + if ((!del || !NIL_P(rb_hash_lookup(del, v))) && + (!nodel || NIL_P(rb_hash_lookup(nodel, v)))) { return Qtrue; } return Qfalse; Index: test/ruby/test_m17n.rb =================================================================== --- test/ruby/test_m17n.rb (revision 14150) +++ test/ruby/test_m17n.rb (revision 14151) @@ -489,4 +489,9 @@ assert_equal(s.tr("A", "B"), s) assert_equal(s.tr_s("A", "B"), s) end + + def test_squeeze + s = "\xa3\xb0\xa3\xb1\xa3\xb1\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + assert_equal("\xa3\xb0\xa3\xb1\xa3\xb3\xa3\xb4".force_encoding("euc-jp"), s.squeeze) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml