diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-10 12:09:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-10 12:09:49 +0000 |
commit | 117438ee7bb5fc99423cec201f804da540e340b8 (patch) | |
tree | b75bc2f4786a1361dc36bfd19ba3f97e91352e1f /test/-ext- | |
parent | 9d170963098fea8e11196cee155ca448bfc01fb3 (diff) |
string.c: term fill
* string.c (rb_str_sub_bang): fill wchar terminator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/string/test_cstr.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/-ext-/string/test_cstr.rb b/test/-ext-/string/test_cstr.rb index a7cb0ebe9c..4535921836 100644 --- a/test/-ext-/string/test_cstr.rb +++ b/test/-ext-/string/test_cstr.rb @@ -60,6 +60,10 @@ class Test_StringCStr < Test::Unit::TestCase assert_wchars_term_char("a"*30) {|s| s[29,1] = ""} end + def test_wchar_sub! + assert_wchars_term_char("foobar") {|s| s.sub!(/#{"foo".encode(s.encoding)}/, "")} + end + def assert_wchars_term_char(str) result = {} WCHARS.map do |enc| |