mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
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/trunk@60060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d35b5a4726
commit
2d42119903
2 changed files with 7 additions and 2 deletions
|
@ -2063,8 +2063,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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue