summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-04 03:55:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-04 03:55:32 +0000
commitbebc52a4a721a1c1d5a98760d58df296ff0d2497 (patch)
tree4abcc62ad82bfe40e38620eb6a3dee6e0c870b7c /test
parent5b92c0bea3dc23b0c2be356bedafdd4e7f9110d7 (diff)
string.c: enable capacity when setting capa
* string.c (rb_str_modify_expand): enable capacity and disable assocation with packed objects when setting capa, so that pack("p") string fails to unpack properly after modified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_pack.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index 621a06beba..3f0931bdc0 100644
--- a/test/ruby/test_pack.rb
+++ b/test/ruby/test_pack.rb
@@ -181,6 +181,7 @@ class TestPack < Test::Unit::TestCase
assert_equal a[0], a.pack("p").unpack("p")[0]
assert_equal a, a.pack("p").freeze.unpack("p*")
assert_raise(ArgumentError) { (a.pack("p") + "").unpack("p*") }
+ assert_raise(ArgumentError) { (a.pack("p") << "d").unpack("p*") }
end
def test_format_string_modified