diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-17 02:06:34 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-17 02:06:34 +0000 |
commit | 38c0b5f0e3abe32d220f01deb77a45aa9100bdcb (patch) | |
tree | dff8a3fc600db20d992e2b232ed0f9ad1e2c410e /test | |
parent | 8f58f60643638add42658d51114abe36dc8257fd (diff) | |
download | ruby-38c0b5f0e3abe32d220f01deb77a45aa9100bdcb.tar.gz |
* 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.rb | 9 |
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 } |