summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_pack.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-17 17:56:41 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-17 17:56:41 +0000
commit81ba64bd417da0de8a4e22352e9d536d76419c98 (patch)
tree90f0288ab5d9d74e5a9eda04d0e6e1c43b7b701a /test/ruby/test_pack.rb
parent713f8925b6e7e6f11e16f170c97557880248179f (diff)
downloadruby-81ba64bd417da0de8a4e22352e9d536d76419c98.tar.gz
ruby-81ba64bd417da0de8a4e22352e9d536d76419c98.tar.xz
ruby-81ba64bd417da0de8a4e22352e9d536d76419c98.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@16452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_pack.rb')
-rw-r--r--test/ruby/test_pack.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index b38893757..30ffe1342 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