diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-26 13:30:35 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-26 13:30:35 +0000 |
commit | 618dadaaaacb7aca96fdc7abb1fd2607835dd08c (patch) | |
tree | d1a7790a8ed84997106cbe500627b57114b6e04f /test | |
parent | 63683cb46dc3553e8cb25311f3306aa271bcc92e (diff) | |
download | ruby-618dadaaaacb7aca96fdc7abb1fd2607835dd08c.tar.gz |
* test/ruby/test_complex.rb: cherry-picked working assertions from r47251.
* test/ruby/test_rational.rb: cherry-picked working assertions from r47263.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_complex.rb | 6 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 7ff7506f6a..78027b7a17 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -205,8 +205,10 @@ class Complex_Test < Test::Unit::TestCase c = Complex(1) if @unify + assert_equal(true, c.integer?) assert_equal(true, c.real?) else + assert_equal(false, c.integer?) assert_equal(false, c.real?) end @@ -463,7 +465,9 @@ class Complex_Test < Test::Unit::TestCase assert_instance_of(Fixnum, Complex(1,2) - Complex(1,2)) assert_instance_of(Fixnum, Complex(1,2) * 0) assert_instance_of(Fixnum, Complex(1,2) / Complex(1,2)) + assert_instance_of(Fixnum, Complex(1,2).div(Complex(1,2))) assert_instance_of(Fixnum, Complex(1,2).quo(Complex(1,2))) + assert_instance_of(Fixnum, Complex(1,2) ** 0) # mathn's bug end end @@ -786,6 +790,7 @@ class Complex_Test < Test::Unit::TestCase assert_equal(false, c.respond_to?(:positive?)) assert_equal(false, c.respond_to?(:negative?)) + assert_equal(false, c.respond_to?(:sign)) assert_equal(false, c.respond_to?(:quotient)) assert_equal(false, c.respond_to?(:quot)) @@ -814,6 +819,7 @@ class Complex_Test < Test::Unit::TestCase assert_equal(Rational(3), Complex(3).to_r) assert_equal(Rational(3), Rational(Complex(3))) assert_raise(RangeError){Complex(3,2).to_r} + assert_raise(RangeError){Rational(Complex(3,2))} end def test_to_c diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index 186987aee2..82299c0c54 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -173,8 +173,10 @@ class Rational_Test < Test::Unit::TestCase c = Rational(1) if @unify + assert_equal(true, c.integer?) assert_equal(true, c.real?) else + assert_equal(false, c.integer?) assert_equal(true, c.real?) end |