summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_string.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-15 05:27:29 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-15 05:27:29 +0000
commit881e092f9650dd807d8fa43f4d2dfb7faaeb1543 (patch)
tree000107f03be24a24f0be0e5296ef42b39a616f3a /test/ruby/test_string.rb
parent3c4ab8c8c5d9ca6e1b418227bbab9f1bb4d60384 (diff)
downloadruby-881e092f9650dd807d8fa43f4d2dfb7faaeb1543.tar.gz
ruby-881e092f9650dd807d8fa43f4d2dfb7faaeb1543.tar.xz
ruby-881e092f9650dd807d8fa43f4d2dfb7faaeb1543.zip
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: http://svn.ruby-lang.org/repos/ruby/trunk@24934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r--test/ruby/test_string.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 36a8f6744..f14e1e856 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -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!