From e8665a6bc271654de993e8cfca08164717236cd1 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 18 Feb 2010 12:53:31 +0000 Subject: * pack.c (pack_unpack): call PACK_ITEM_ADJUST for 'Q'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_pack.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 6101a30219..7cc3f0089e 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -491,4 +491,11 @@ class TestPack < Test::Unit::TestCase def test_length_too_big assert_raise(RangeError) { [].pack("C100000000000000000000") } end + + def test_short_string + %w[n N v V s S l L q Q].each {|fmt| + str = [1].pack(fmt) + assert_equal([1,nil], str.unpack("#{fmt}2")) + } + end end -- cgit v1.2.3