summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_set.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_set.rb b/test/ruby/test_set.rb
index 225b7da78c..2bb7858eb2 100644
--- a/test/ruby/test_set.rb
+++ b/test/ruby/test_set.rb
@@ -643,6 +643,11 @@ class TC_Set < Test::Unit::TestCase
assert_equal([o], Set.new.merge(a).to_a)
end
+ def test_initialize_mutating_array_bug_21306
+ a = (1..100).to_a
+ assert_equal(Set[0], Set.new(a){a.clear; 0})
+ end
+
def test_subtract
set = Set[1,2,3]