From a0e236f6065e5dfd68ac8a45ad1ca690042d47b9 Mon Sep 17 00:00:00 2001 From: mame Date: Sat, 17 May 2008 17:56:41 +0000 Subject: * pack.c (pack_pack): check errno to detect error of ruby_strtoul. * pack.c (pack_unpack): ditto. * test/ruby/test_pack.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_pack.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby/test_pack.rb') diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index b388937578..30ffe13426 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -441,4 +441,8 @@ class TestPack < Test::Unit::TestCase end.join end end + + def test_length_too_big + assert_raise(RangeError) { [].pack("C100000000000000000000") } + end end -- cgit v1.2.3