From 64989fa5a2a8022aee8e6a5b71eb1e77eba5ce82 Mon Sep 17 00:00:00 2001 From: naruse Date: Sun, 30 Sep 2012 12:20:09 +0000 Subject: * string.c (rb_str_concat): use memcpy to copy a string which contains NUL characters. [ruby-core:47751] [Bug #7090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/test_string.rb') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index bb0d9b04f9..d5778ab747 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -473,6 +473,12 @@ class TestString < Test::Unit::TestCase def test_concat assert_equal(S("world!"), S("world").concat(33)) assert_equal(S("world!"), S("world").concat(S('!'))) + + bug7090 = '[ruby-core:47751]' + result = S("").force_encoding(Encoding::UTF_16LE) + result << 0x0300 + expected = S("\u0300".encode(Encoding::UTF_16LE)) + assert_equal(expected, result, bug7090) end def test_count -- cgit v1.2.3