summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-10 14:44:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-10 14:44:51 +0000
commit037a9d06559e25cce2368979cecba710ddb4765d (patch)
tree0be9ec71e9ea51081b5c57f7c69495d869f92b7f /test/ruby
parente5b5ee7487a55f6afd3bed90c6716a07ba0d3065 (diff)
array.c, hash.c: add salt
* array.c (rb_ary_hash): add salt to differentiate false and empty array. [ruby-core:58993] [Bug #9231] * hash.c (rb_any_hash, rb_hash_hash): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_array.rb2
-rw-r--r--test/ruby/test_hash.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 1f434e37fa..fb78085e61 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -909,6 +909,8 @@ class TestArray < Test::Unit::TestCase
a3 = @cls[ 'dog', 'cat' ]
assert_equal(a1.hash, a2.hash)
assert_not_equal(a1.hash, a3.hash)
+ bug9231 = '[ruby-core:58993] [Bug #9231]'
+ assert_not_equal(false.hash, @cls[].hash, bug9231)
end
def test_include?
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index afb0ca4805..8c8ce6d7c3 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -883,6 +883,8 @@ class TestHash < Test::Unit::TestCase
h = @cls[1=>2]
h.shift
assert_equal({}.hash, h.hash, '[ruby-core:38650]')
+ bug9231 = '[ruby-core:58993] [Bug #9231]'
+ assert_not_equal(0, @cls[].hash, bug9231)
end
def test_update2