diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-05 01:54:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-05 01:54:22 +0000 |
commit | 3614f8bd1c813916054079055d13462e90808a96 (patch) | |
tree | 630977a8a3021123bf01dd0e3639f9b2215e1a8d /test | |
parent | 6c41b73decf61254ac9c3bc3fc0e1d0169d5b524 (diff) | |
download | ruby-3614f8bd1c813916054079055d13462e90808a96.tar.gz |
string.c: wchar terminator
* string.c (rb_str_lstrip_bang, rb_str_rstrip_bang): terminate
wchar strings with wchar 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/-ext-/string/test_cstr.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/-ext-/string/test_cstr.rb b/test/-ext-/string/test_cstr.rb index f691da6f79..1809fa186a 100644 --- a/test/-ext-/string/test_cstr.rb +++ b/test/-ext-/string/test_cstr.rb @@ -39,4 +39,16 @@ class Test_StringCStr < Test::Unit::TestCase assert_equal(0, s.cstr_term) end end + + def test_wchar_lstrip! + str = Bug::String.new(" a".encode(Encoding::UTF_16BE)) + str.lstrip! + assert_nil(str.cstr_term_char) + end + + def test_wchar_rstrip! + str = Bug::String.new("a ".encode(Encoding::UTF_16BE)) + str.rstrip! + assert_nil(str.cstr_term_char) + end end |