1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
mame 2008-01-22 13:28:04 +00:00
parent 5b3b96bb19
commit 008d77d27c
2 changed files with 17 additions and 3 deletions

View file

@ -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.

View file

@ -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