diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-17 14:53:00 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-17 14:53:00 +0000 |
commit | 94468b4ea5d46eed4280841b7770f650870b52b3 (patch) | |
tree | f2e4cfaf96d362d3d00fc73c9624adb41f6edc07 /test/ruby/test_bignum.rb | |
parent | af2d3c98664d83519a3334d560fad3ecdc6990ee (diff) | |
download | ruby-94468b4ea5d46eed4280841b7770f650870b52b3.tar.gz |
numeric.c, complex.c: Add finite? and infinite? consistent with Float
* numeric.c (num_finite_p, num_infinite_p): Add Numeric#finite? and
Numeric#infinite? [Feature #12039] [ruby-core:73618]
* complex.c (rb_complex_finite_p): Add Complex#finite?
* complex.c (rb_complex_infinite_p): Add Complex#infinite?
* test/ruby/test_bignum.rb: Add test for Integer#finite? and
Integer#infinite?
* test/ruby/test_fixnum.rb: ditto.
* test/ruby/test_rational.rb: Add test for Rational#finite? and
Rational#infinite?
* test/ruby/test_complex.rb: Add test for Complex#finite? and
Complex#infinite?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_bignum.rb')
-rw-r--r-- | test/ruby/test_bignum.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 582a326eb6..15811d5d43 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -778,5 +778,15 @@ class TestBignum < Test::Unit::TestCase assert_raise(TypeError) { T1024P.digits("10") } assert_raise(TypeError) { T1024P.digits("a") } end + + def test_finite_p + assert_predicate(T1024P, :finite?) + assert_predicate(-T1024P, :finite?) + end + + def test_infinite_p + assert_nil(T1024P.infinite?) + assert_nil((-T1024P).infinite?) + end end end |