From 73a184cc3a4ead8a3242a8f04c4e65fa99026eef Mon Sep 17 00:00:00 2001 From: naruse Date: Sun, 25 Mar 2012 09:20:04 +0000 Subject: * string.c (tr_setup_table): fix multiple non latin argument for non latin (over 256 characters) tr-like methods. [ruby-core:43371] [Bug #6167] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index f8336679b5..27cb3a2552 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -483,8 +483,15 @@ class TestString < Test::Unit::TestCase assert_equal(4, a.count(S("ej-m"))) assert_equal(0, S("y").count(S("a\\-z"))) assert_equal(5, "abc\u{3042 3044 3046}".count("^a")) + assert_equal(1, "abc\u{3042 3044 3046}".count("\u3042")) assert_equal(5, "abc\u{3042 3044 3046}".count("^\u3042")) assert_equal(2, "abc\u{3042 3044 3046}".count("a-z", "^a")) + assert_equal(0, "abc\u{3042 3044 3046}".count("a", "\u3042")) + assert_equal(0, "abc\u{3042 3044 3046}".count("\u3042", "a")) + assert_equal(0, "abc\u{3042 3044 3046}".count("\u3042", "\u3044")) + assert_equal(4, "abc\u{3042 3044 3046}".count("^a", "^\u3044")) + assert_equal(4, "abc\u{3042 3044 3046}".count("^\u3044", "^a")) + assert_equal(4, "abc\u{3042 3044 3046}".count("^\u3042", "^\u3044")) assert_raise(ArgumentError) { "foo".count } end -- cgit v1.2.3