diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-22 13:28:04 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-22 13:28:04 +0000 |
commit | 008d77d27cf2e468ca5e1d8a7d0c5f8cc102fd89 (patch) | |
tree | b3128cff862be8452bc31365139790f9a30d121a /test/ruby/test_bignum.rb | |
parent | 5b3b96bb1913f57301b86845c641412c137cc29f (diff) | |
download | ruby-008d77d27cf2e468ca5e1d8a7d0c5f8cc102fd89.tar.gz |
* test/ruby/test_bignum.rb: change some tests because rational
redefines Bignum#quo and Bignum#**.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_bignum.rb')
-rw-r--r-- | test/ruby/test_bignum.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index c70237b356..26e6becdb2 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -236,12 +236,18 @@ class TestBignum < Test::Unit::TestCase assert_equal(T32.to_f, T32.quo(1)) assert_equal(T32.to_f, T32.quo(1.0)) assert_equal(T32.to_f, T32.quo(T_ONE)) - assert_raise(TypeError) { T32.quo("foo") } + + ### rational changes the behavior of Bignum#quo + #assert_raise(TypeError) { T32.quo("foo") } + assert_raise(TypeError, NoMethodError) { T32.quo("foo") } + assert_equal(1024**1024, (1024**1024).quo(1)) assert_equal(1024**1024, (1024**1024).quo(1.0)) assert_equal(1024**1024*2, (1024**1024*2).quo(1)) inf = 1 / 0.0; nan = inf / inf - assert_raise(FloatDomainError) { (1024**1024*2).quo(nan) } + + ### rational changes the behavior of Bignum#quo + #assert_raise(FloatDomainError) { (1024**1024*2).quo(nan) } end def test_pow @@ -249,7 +255,10 @@ class TestBignum < Test::Unit::TestCase assert_equal(1.0 / T32, T32 ** -1) assert((T32 ** T32).infinite?) assert((T32 ** (2**30-1)).infinite?) - assert_raise(TypeError) { T32**"foo" } + + ### rational changes the behavior of Bignum#** + #assert_raise(TypeError) { T32**"foo" } + assert_raise(TypeError, ArgumentError) { T32**"foo" } end def test_and |