summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-17 11:00:09 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-17 11:00:09 +0000
commitd965e99b04bc250e8129f5909383ffdff53c0149 (patch)
tree56d89c14dcdc093dabb04b5b2aa04b9f8847521c /test
parentb452a519c90b539b17a92e1e465d937fe3abc7ab (diff)
* complex.c (nucomp_s_convert): accepts complex
value (Complex(a,b) as a+bi). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_complex.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index 6a5eb0c484..5aa741065a 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -158,6 +158,9 @@ class Complex_Test < Test::Unit::TestCase
c = Complex(0,Complex(1))
assert_equal(Complex.__send__(:new, 0,1), c)
+ c = Complex(Complex(1,1),Complex(1))
+ assert_equal(Complex.__send__(:new, 1,2), c)
+
c = 5.re
assert_equal(Complex.__send__(:new, 5,0), c)
@@ -169,7 +172,7 @@ class Complex_Test < Test::Unit::TestCase
c = Complex(2,0).im
assert_equal(Complex.__send__(:new, 0,2), c)
- assert_raise(ArgumentError){Complex(1,2).im}
+ assert_equal(Complex.__send__(:new, -2,1), Complex(1,2).im)
c = Complex::I
assert_equal(Complex.__send__(:new, 0,1), c)