aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_pack.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_pack.rb')
-rw-r--r--test/ruby/test_pack.rb7
1 files changed, 7 insertions, 0 deletions
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