summaryrefslogtreecommitdiff
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-03 13:32:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-03 13:32:24 +0000
commit218d1f5e1e2377b237c294e871bd3bfd6abf6633 (patch)
tree5d10d6718b479a1f3ad9eab92365881b3415a5fd /test/ruby/test_array.rb
parent6f2efe84fb6169a03ed191606935a40640d6764c (diff)
hash.c: same hash value for similar constructs
* hash.c (rb_hash_recursive): make similar (recursive) constructs return same hash value. execute recursively, and rewind to the topmost frame with an object which .eql? to the recursive object, if recursion is detected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index d53b345898..0235f00471 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -2053,6 +2053,7 @@ class TestArray < Test::Unit::TestCase
assert_not_equal([[1]].hash, [[2]].hash)
a = []
a << a
+ assert_equal([[a]].hash, a.hash)
assert_not_equal([a, 1].hash, [a, 2].hash)
assert_not_equal([a, a].hash, a.hash) # Implementation dependent
end