From ba20fe6289984abf051f86e4dae254dcb071c86e Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 16 Mar 2012 11:06:27 +0000 Subject: * string.c (trnext): should advance char-wise. [ruby-core:43335][Bug #6156] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 3b1029ecdd..17de2ece2d 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1500,6 +1500,10 @@ class TestString < Test::Unit::TestCase assert_equal(true, "\u0101".tr("\u0101", "a").ascii_only?) assert_equal(true, "\u3041".tr("\u3041", "a").ascii_only?) assert_equal(false, "\u3041\u3042".tr("\u3041", "a").ascii_only?) + + bug6156 = '[ruby-core:43335]' + str, range, star = %w[b a-z *].map{|s|s.encode("utf-16le")} + assert_equal(star, str.tr(range, star), bug6156) end def test_tr! -- cgit v1.2.3