diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-05 02:35:13 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-05 02:35:13 +0000 |
commit | 673745f7999bdb5b8c0909f00b7d0fa14a0af43c (patch) | |
tree | 31bd60dc03943499907a3c0059256053f78f3912 /test/ruby/test_pack.rb | |
parent | 3da0a0cead8eb70dba54d291151d2e9458a0159d (diff) |
merge revision(s) 44803: [Backport #9478]
* 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/branches/ruby_2_1@44819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_pack.rb')
-rw-r--r-- | test/ruby/test_pack.rb | 1 |
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 |