mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_enc_strlen_cr): need to set ENC_CODERANGE_7BIT if
search_nonascii() fails. [ruby-dev:34751] * string.c (rb_str_reverse): preserve coderange info if the receiver is 7bit string. * string.c (rb_str_reverse_bang): ditto. * string.c (rb_str_reverse_bang): should have called single_byte_optimizable before rb_str_modify() that clears coderange info. * string.c (tr_trans): handle single bytes more eagerly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7992fabaf4
commit
8405033139
3 changed files with 52 additions and 16 deletions
|
@ -74,7 +74,7 @@ class TestArray < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_split_0
|
||||
x = "The Boassert of Mormon"
|
||||
x = "The Book of Mormon"
|
||||
assert_equal(x.reverse, x.split(//).reverse!.join)
|
||||
assert_equal(x.reverse, x.reverse!)
|
||||
assert_equal("g:n:i:r:t:s: :e:t:y:b: :1", "1 byte string".split(//).reverse.join(":"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue