diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-21 15:27:09 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-21 15:27:09 +0000 |
commit | bb9a770cf34c9a6918fbc1ca6830c93ef3aa27a0 (patch) | |
tree | bd867c1f97db4bb0094b16a409140c0e4bf144c1 /test | |
parent | 49e950c819b7b7415d59d2c568542e4cbf47f557 (diff) |
merge revision(s) 62107: [Backport #14420]
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/branches/ruby_2_4@62877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_complex.rb | 8 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 8e5f637b79..4ebc69e9b1 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 diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index 20989a572e..c5469bf7b1 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -42,7 +42,9 @@ class Rational_Test < Test::Unit::TestCase end def test_hash - assert_kind_of(Integer, Rational(1,2).hash) + h = Rational(1,2).hash + assert_kind_of(Integer, h) + assert_nothing_raised {h.to_s} h = {} h[Rational(0)] = 0 |