diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | bootstraptest/test_knownbug.rb | 7 | ||||
-rw-r--r-- | string.c | 4 | ||||
-rw-r--r-- | test/ruby/test_m17n.rb | 5 |
4 files changed, 13 insertions, 8 deletions
@@ -1,3 +1,8 @@ +Sun Dec 9 12:12:23 2007 Nobuyoshi Nakada <[email protected]> + + * string.c (tr_find): returns true if no characters to be removed is + specified. + Sun Dec 9 12:03:16 2007 Nobuyoshi Nakada <[email protected]> * parse.y (parser_magic_comment): delimits with a semicolon. diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index a9cb8eb1a5..d2e36cfcd1 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -156,9 +156,4 @@ assert_equal 'true', %q{ "\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]' @@ -3674,8 +3674,8 @@ tr_find(int c, char table[256], VALUE del, VALUE nodel) 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; diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 542c3d2b00..28f636fc65 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -489,4 +489,9 @@ class TestM17N < Test::Unit::TestCase 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 |