summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-03 16:01:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-03 16:01:16 +0000
commit228f30be3a96d078179eb1e1773a226c50c4e1a2 (patch)
tree5425f2861bd8fed40999a2c21659821f500fc826 /test
parent5d6602c44e95862d28e05591798d790d0ad80dfb (diff)
* bignum.c (Init_Bignum): rdiv method removed. [ruby-dev:34242]
* complex.c (nucomp_quo): ditto. * numeric.c (num_rdiv): ditto. * rational.c (nurat_div): ditto. * complex.c (nucomp_fdiv): fdiv implementation restored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_complex.rb32
-rw-r--r--test/ruby/test_rational.rb15
2 files changed, 4 insertions, 43 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index bfa9859199..c1a2cfa662 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -413,30 +413,6 @@ class Complex_Test < Test::Unit::TestCase
end
end
- def test_rdiv
- if defined?(Rational) && !Rational.instance_variable_get('@RCS_ID')
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- assert_equal(Complex(Rational(8,13),Rational(1,13)), c.rdiv(c2))
-
- c = Complex(1.0,2.0)
- c2 = Complex(2.0,3.0)
-
- r = c.rdiv(c2)
- assert_in_delta(0.615, r.real, 0.001)
- assert_in_delta(0.076, r.image, 0.001)
-
- c = Complex(1,2)
- c2 = Complex(2,3)
-
- assert_equal(Complex(Rational(1,2),1), c.rdiv(2))
-
- assert_equal(Complex(Rational(1,2),Rational(1)), c / Rational(2))
- assert_equal(Complex(Rational(3,2),Rational(3)), c / Rational(2,3))
- end
- end
-
def test_fdiv
c = Complex(1,2)
c2 = Complex(2,3)
@@ -880,10 +856,10 @@ class Complex_Test < Test::Unit::TestCase
end
if defined?(Rational) && !Rational.instance_variable_get('@RCS_ID')
- assert_equal(Rational(1,2), 1.rdiv(2))
- assert_equal(Rational(5000000000), 10000000000.rdiv(2))
- assert_equal(Rational(1,2), 1.0.rdiv(2))
- assert_equal(Rational(1,4), Rational(1,2).rdiv(2))
+ assert_equal(Rational(1,2), 1.quo(2))
+ assert_equal(Rational(5000000000), 10000000000.quo(2))
+ assert_equal(Rational(1,2), 1.0.quo(2))
+ assert_equal(Rational(1,4), Rational(1,2).quo(2))
assert_equal(Complex(Rational(1,2),Rational(1)), Complex(1,2).quo(2))
end
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index 899ecf5022..a40d6c6d76 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -502,16 +502,6 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(Rational(0.25), c.quo(2.0))
end
- def test_rdiv
- c = Rational(1,2)
- c2 = Rational(2,3)
-
- assert_equal(Rational(3,4), c.rdiv(c2))
-
- assert_equal(Rational(1,4), c.rdiv(2))
- assert_equal(Rational(0.25), c.rdiv(2.0))
- end
-
def test_fdiv
c = Rational(1,2)
c2 = Rational(2,3)
@@ -946,11 +936,6 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(Rational(1,2), 1.0.quo(2))
assert_equal(Rational(1,4), Rational(1,2).quo(2))
- assert_equal(Rational(1,2), 1.rdiv(2))
- assert_equal(Rational(5000000000), 10000000000.rdiv(2))
- assert_equal(Rational(1,2), 1.0.rdiv(2))
- assert_equal(Rational(1,4), Rational(1,2).rdiv(2))
-
assert_equal(0.5, 1.fdiv(2))
assert_equal(5000000000.0, 10000000000.fdiv(2))
assert_equal(0.5, 1.0.fdiv(2))