summaryrefslogtreecommitdiff
path: root/test/-ext-/string/test_cstr.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-03 04:52:13 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-03 04:52:13 +0000
commit040ce056101bc9a8d9a5b0ed5d6a5835ec31be26 (patch)
tree82fd70a465e7b4ff794d2bfd9806fb6ed29ebbeb /test/-ext-/string/test_cstr.rb
parente14c9f10489759a601fbdfd2af41909c6fe54c1b (diff)
* string.c (str_new_frozen): if the given string is embeddedable
but not embedded, embed a new copied string. [Bug #11946] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/string/test_cstr.rb')
-rw-r--r--test/-ext-/string/test_cstr.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/-ext-/string/test_cstr.rb b/test/-ext-/string/test_cstr.rb
index f4ed520..35b5fe5 100644
--- a/test/-ext-/string/test_cstr.rb
+++ b/test/-ext-/string/test_cstr.rb
@@ -36,6 +36,12 @@ class Test_StringCStr < Test::Unit::TestCase
end
end
+ def test_rb_str_new_frozen_embed
+ str = Bug::String.cstr_noembed("rbconfig.rb")
+ str = Bug::String.rb_str_new_frozen(str)
+ assert_equal true, Bug::String.cstr_embedded?(str)
+ end
+
WCHARS = [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE]
def test_wchar_embed