summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-17 02:06:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-17 02:06:34 +0000
commit38c0b5f0e3abe32d220f01deb77a45aa9100bdcb (patch)
treedff8a3fc600db20d992e2b232ed0f9ad1e2c410e /test
parent8f58f60643638add42658d51114abe36dc8257fd (diff)
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_hash.rb9
1 files changed, 9 insertions, 0 deletions
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 }