summaryrefslogtreecommitdiff
path: root/test/test_set.rb
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2021-03-15 22:15:03 -0400
committerMarc-Andre Lafortune <github@marc-andre.ca>2021-03-18 07:34:40 -0400
commit0ef2923c2b9afb76b3a1cebc56ebabc71c9a2ba8 (patch)
treea5572db3a246e53e1293823249e8ad4413ef061b /test/test_set.rb
parentd094c3ef046aba0bb99fd08bcbc72ff87216e736 (diff)
Avoid rehashing in Hash#replace/dup/initialize_copy [Bug #16996]
Diffstat (limited to 'test/test_set.rb')
-rw-r--r--test/test_set.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/test_set.rb b/test/test_set.rb
index e62f30d852..af9806ed51 100644
--- a/test/test_set.rb
+++ b/test/test_set.rb
@@ -637,11 +637,10 @@ class TC_Set < Test::Unit::TestCase
assert_not_equal(Set[1], [1])
set1 = Class.new(Set)["a", "b"]
- set2 = Set["a", "b", set1]
- set1 = set1.add(set1.clone)
+ set1.add(set1).reset # Make recursive
+ set2 = Set["a", "b", Set["a", "b", set1]]
- assert_equal(set2, set2.clone)
- assert_equal(set1.clone, set1)
+ assert_equal(set1, set2)
assert_not_equal(Set[Exception.new,nil], Set[Exception.new,Exception.new], "[ruby-dev:26127]")
end