diff options
Diffstat (limited to 'test/ruby/test_pack.rb')
-rw-r--r-- | test/ruby/test_pack.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 8dbfd95809..d696dd70a1 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -794,4 +794,23 @@ EXPECTED } } end + + def test_pack_resize + assert_separately([], <<-'end;') + ary = [] + obj = Class.new { + define_method(:to_str) { + ary.clear() + ary = nil + GC.start + "TALOS" + } + }.new + + ary.push(obj) + ary.push(".") + + assert_raise_with_message(ArgumentError, /too few/) {ary.pack("AA")} + end; + end end |