diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:54:01 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:54:01 +0000 |
commit | c71b916f37c5dc0c0202b4410af2c3dc1c740bb9 (patch) | |
tree | 98c38f4178c5e3badce86f6bb073479d9889de51 /test/ruby | |
parent | 6d2a37a0e74ade72c0750c5c8446a654469b2db1 (diff) |
merge revision(s) 15645:15647:
* bignum.c (big2str_find_n1): check integer overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_bignum.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index c238337db5..e070a9c866 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -84,4 +84,12 @@ class TestBignum < Test::Unit::TestCase shift_test(-4518325415524767873) shift_test(-0xfffffffffffffffff) end + + def test_too_big_to_s + if (big = 2**31-1).is_a?(Fixnum) + return + end + e = assert_raise(RangeError) {(1 << big).to_s} + assert_match(/too big to convert/, e.message) + end end |