aboutsummaryrefslogtreecommitdiffstats
path: root/test/-ext-
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-25 02:05:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-25 02:05:34 +0000
commit2f2ac327e5a9fef76059f1c812a0c1001c607e70 (patch)
treeb35e626dd5bb3e33f97dffd37f6b4f228d27f7a1 /test/-ext-
parentcdd8ce2632b5c38caf27ab40aa27ea4b0011fa14 (diff)
downloadruby-2f2ac327e5a9fef76059f1c812a0c1001c607e70.tar.gz
string.c: fill the terminator
* string.c (str_replace_shared_without_enc): fill the terminator of embedded strings in wide char encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/string/test_cstr.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/-ext-/string/test_cstr.rb b/test/-ext-/string/test_cstr.rb
index 1e973d0a39..7e24ec6a70 100644
--- a/test/-ext-/string/test_cstr.rb
+++ b/test/-ext-/string/test_cstr.rb
@@ -86,6 +86,14 @@ class Test_StringCStr < Test::Unit::TestCase
}
end
+ def test_wchar_replace
+ assert_wchars_term_char("abc") {|s|
+ w = s.dup
+ s.replace("abcdefghijklmnop")
+ s.replace(w)
+ }
+ end
+
def test_embedded_from_heap
gh821 = "[GH-821]"
embedded_string = "abcdefghi"