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 | 8f1db1cbc41e8eececb4824b5cd2838c8867327c (patch) | |
tree | b3128cff862be8452bc31365139790f9a30d121a | |
parent | e48faf94d50e592322b9be879b2f5ffce1667d7b (diff) | |
download | ruby-8f1db1cbc41e8eececb4824b5cd2838c8867327c.tar.gz ruby-8f1db1cbc41e8eececb4824b5cd2838c8867327c.tar.xz ruby-8f1db1cbc41e8eececb4824b5cd2838c8867327c.zip |
* test/ruby/test_bignum.rb: change some tests because rational
redefines Bignum#quo and Bignum#**.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_bignum.rb | 15 |
2 files changed, 17 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Tue Jan 22 22:26:23 2008 Yusuke Endoh <mame@tsg.ne.jp> + + * test/ruby/test_bignum.rb: change some tests because rational + redefines Bignum#quo and Bignum#**. + Tue Jan 22 20:58:15 2008 NAKAMURA Usaku <usa@ruby-lang.org> * lib/mkmf.rb (create_makefile): need to output sodir rule. diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index c70237b35..26e6becdb 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 |