From 38c0b5f0e3abe32d220f01deb77a45aa9100bdcb Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 17 Oct 2012 02:06:34 +0000 Subject: * test/ruby/test_hash.rb (TestHash#test_dup_equality): added a new test to show the problem of r37232. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_hash.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 1806746ef2..f1eef88d99 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -325,6 +325,15 @@ class TestHash < Test::Unit::TestCase end end + def test_dup_equality + h = {'k' => 'v'} + assert_equal(h, h.dup) + h1 = {h => 1} + assert_equal(h1, h1.dup) + h[1] = 2 + assert_equal(h1, h1.dup) + end + def test_each count = 0 @cls[].each { |k, v| count + 1 } -- cgit v1.2.3