diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-24 18:46:48 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-24 18:46:48 +0000 |
commit | ac60468656989736752d406d570767c490820fa3 (patch) | |
tree | ab7d8ac9e833d32944f03168ca578737e5c177ae /test/ruby | |
parent | 04aa6a8168463c00560a819f6fa85a309558d63c (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_4@61453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index d7d1f11991..2c18229511 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1851,8 +1851,13 @@ CODE 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! |