summaryrefslogtreecommitdiff
path: root/test/ruby/test_complex.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-30 05:48:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-30 05:48:28 +0000
commit3f7221ad3dbe89832e330079df4b80e633b016ef (patch)
tree4a0ad8aad62209a1a00a039f07ef1afff3859ef9 /test/ruby/test_complex.rb
parent5af43b1ec2674e9f86090790bc61abdb96be14ff (diff)
force fixable
* complex.c (nucomp_hash): force hash values fixable. [ruby-core:85224] [Bug #14420] * rational.c (nurat_hash): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_complex.rb')
-rw-r--r--test/ruby/test_complex.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb
index ded316841a..316e3e21ff 100644
--- a/test/ruby/test_complex.rb
+++ b/test/ruby/test_complex.rb
@@ -48,8 +48,12 @@ class Complex_Test < Test::Unit::TestCase
end
def test_hash
- assert_kind_of(Integer, Complex(1,2).hash)
- assert_kind_of(Integer, Complex(1.0,2.0).hash)
+ h = Complex(1,2).hash
+ assert_kind_of(Integer, h)
+ assert_nothing_raised {h.to_s}
+ h = Complex(1.0,2.0).hash
+ assert_kind_of(Integer, h)
+ assert_nothing_raised {h.to_s}
h = {}
h[Complex(0)] = 0