summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_complex.rb6
-rw-r--r--test/ruby/test_rational.rb2
3 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f06810813..181e07b166 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 26 22:07:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_complex.rb: cherry-picked working assertions from r47251.
+ * test/ruby/test_rational.rb: cherry-picked working assertions from r47263.
+
Tue Aug 26 21:07:56 2014 gogo tanaka <mail@tanakakazuki.com>
* lib/mathn.rb (Fixnum#**, Bignum#**, Float#**, Rational#**):
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