mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
Use rb_isspace for ASCII-incompatible strings.
* string.c (rb_str_split_m): use rb_isspace when the string may be ASCII-incompatible. (rb_str_lstrip_bang): ditto. (rb_str_rstrip_bang): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c59abe419d
commit
a8154060ab
3 changed files with 18 additions and 4 deletions
|
@ -1139,6 +1139,11 @@ class TestString < Test::Unit::TestCase
|
|||
def test_strip
|
||||
assert_equal(S("x"), S(" x ").strip)
|
||||
assert_equal(S("x"), S(" \n\r\t x \t\r\n\n ").strip)
|
||||
|
||||
assert_equal("0b0 ".force_encoding("UTF-16BE"),
|
||||
"\x00 0b0 ".force_encoding("UTF-16BE").strip)
|
||||
assert_equal("0\x000b0 ".force_encoding("UTF-16BE"),
|
||||
"0\x000b0 ".force_encoding("UTF-16BE").strip)
|
||||
end
|
||||
|
||||
def test_strip!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue