summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 13:26:35 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 13:26:35 +0000
commita852edd817da6d66b9e034e18f68b5b75566a9b2 (patch)
tree060d4a241cb7bce514eb99935a9168b3c6c3467d /test
parent91e4978bb0f1fac38226733324828599e7359484 (diff)
merge revision(s) 60060: [Backport #13950]
string.c: ASCII-incompatible is not ASCII only * string.c (tr_trans): ASCII-incompatible encoding strings cannot be ASCII-only even if valid. [ruby-core:83056] [Bug #13950] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_string.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 2a19b055be..61a69b1c7b 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1723,8 +1723,13 @@ class TestString < Test::Unit::TestCase
assert_equal(false, "\u3041\u3042".tr("\u3041", "a").ascii_only?)
bug6156 = '[ruby-core:43335]'
+ bug13950 = '[ruby-core:83056] [Bug #13950]'
str, range, star = %w[b a-z *].map{|s|s.encode("utf-16le")}
- assert_equal(star, str.tr(range, star), bug6156)
+ result = str.tr(range, star)
+ assert_equal(star, result, bug6156)
+ assert_not_predicate(str, :ascii_only?)
+ assert_not_predicate(star, :ascii_only?)
+ assert_not_predicate(result, :ascii_only?, bug13950)
end
def test_tr!