summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-29 07:51:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-29 07:51:23 +0000
commitbe24b385ffb2c31e5f0974aee55bce1e37f1bc2b (patch)
tree8ab725e28efaeb91cdf7f216dce8e6ac62907dce /test
parentac82a1b2058a0f5049bf77895003cbf0ba092f4c (diff)
ChangeLog: commit miss
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_hash.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 1baff2982c8..e8b8ef040c8 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -102,6 +102,12 @@ class TestHash < Test::Unit::TestCase
assert_raises(TypeError) { h.dup }
end
+ def test_clear_initialize_copy
+ h = @cls[1=>2]
+ h.instance_eval {initialize_copy({})}
+ assert_empty(h)
+ end
+
def test_dup_will_rehash
set1 = { }
set2 = { set1 => true}
@@ -912,13 +918,17 @@ class TestHash < Test::Unit::TestCase
def test_compare_by_identity
a = "foo"
- assert_not_predicate({}, :compare_by_identity?)
- h = { a => "bar" }
+ assert_not_predicate(@cls[], :compare_by_identity?)
+ h = @cls[a => "bar"]
assert_not_predicate(h, :compare_by_identity?)
h.compare_by_identity
assert_predicate(h, :compare_by_identity?)
#assert_equal("bar", h[a])
assert_nil(h["foo"])
+
+ bug8703 = '[ruby-core:56256] [Bug #8703] copied identhash'
+ h.clear
+ assert_predicate(h.dup, :compare_by_identity?, bug8703)
end
class ObjWithHash