diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_hash.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 7cf5b8a98d..9fe64b38a0 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -1088,6 +1088,17 @@ class TestHash < Test::Unit::TestCase assert_predicate(h.dup, :compare_by_identity?, bug8703) end + def test_same_key + bug9646 = '[ruby-dev:48047] [Bug #9646] Infinite loop at Hash#each' + h = @cls[a=[], 1] + a << 1 + h[[]] = 2 + a.clear + cnt = 0 + r = h.each{ break nil if (cnt+=1) > 100 } + assert_not_nil(r,bug9646) + end + class ObjWithHash def initialize(value, hash) @value = value |