summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_complex.rb
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-15 04:20:46 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-15 04:20:46 +0000
commit625e48e720d72a7959815a78d6a4d3ce89d8d56d (patch)
tree67826d260d299bc16de16604fc7e48b85e353638 /test/ruby/test_complex.rb
parent1288dc298ea81bc2a775950ad6d198575b1891a5 (diff)
downloadruby-625e48e720d72a7959815a78d6a4d3ce89d8d56d.tar.gz
ruby-625e48e720d72a7959815a78d6a4d3ce89d8d56d.tar.xz
ruby-625e48e720d72a7959815a78d6a4d3ce89d8d56d.zip
* complex.c (nucomp_eql_p): new.
* complex.c (nucomp_hash): should use hash values of the elements. * rational.c (nurat_hash): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_complex.rb')
-rw-r--r--test/ruby/test_complex.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index 6f9cabb7b..493e2e2c3 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -51,6 +51,7 @@ class Complex_Test < Test::Unit::TestCase
def test_hash
assert_instance_of(Fixnum, Complex(1,2).hash)
+ assert_instance_of(Fixnum, Complex(1.0,2.0).hash)
h = {}
h[Complex(0)] = 0
@@ -63,6 +64,9 @@ class Complex_Test < Test::Unit::TestCase
h[Complex(0,0)] = 9
assert_equal(4, h.size)
+
+ h[Complex(0.0,0.0)] = 9.0
+ assert_equal(5, h.size)
end
def test_freeze