diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-14 06:37:00 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-14 06:37:00 +0000 |
commit | 640c135cbe3a0147cca1e9bf767d8cc5ae72b2bd (patch) | |
tree | 8d66866c59af1de3221dcb475344468cb6aa022a /test | |
parent | 4fe4f46592c2ba4d42a25e8559d51307b24ee0af (diff) |
merge revision(s) 51423,51425: [Backport #9381]
test_hash.rb: add assertions
* test/ruby/test_hash.rb (test_wrapper_of_special_const): test
other special obejcts. [Bug #9381]
* hash.c (rb_any_hash): fix Float hash. rb_dbl_hash() returns a
Fixnum, but not a long. [Bug #9381]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@51572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_hash.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 86305ee958..1bb32f663e 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -1264,8 +1264,14 @@ class TestHash < Test::Unit::TestCase end end - hash = {5 => bug9381} - assert_equal(bug9381, hash[wrapper.new(5)]) + bad = [ + 5, true, false, nil, + 0.0, 1.72723e-77, + ].select do |x| + hash = {x => bug9381} + hash[wrapper.new(x)] != bug9381 + end + assert_empty(bad, bug9381) end def test_label_syntax |