diff options
| author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-17 11:00:09 +0000 |
|---|---|---|
| committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-17 11:00:09 +0000 |
| commit | c9565726652de429d34fbd0f6fc3a45a18a5a7b1 (patch) | |
| tree | 56d89c14dcdc093dabb04b5b2aa04b9f8847521c /test/ruby | |
| parent | 7c03431929ae7fd6508acf88001fb80acf0cfe29 (diff) | |
| download | ruby-c9565726652de429d34fbd0f6fc3a45a18a5a7b1.tar.gz ruby-c9565726652de429d34fbd0f6fc3a45a18a5a7b1.tar.xz ruby-c9565726652de429d34fbd0f6fc3a45a18a5a7b1.zip | |
* complex.c (nucomp_s_convert): accepts complex
value (Complex(a,b) as a+bi).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_complex.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 6a5eb0c48..5aa741065 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) |
