summaryrefslogtreecommitdiff
path: root/test/test_set.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-10-27 16:03:07 -0700
committerJeremy Evans <code@jeremyevans.net>2020-06-11 14:02:00 -0700
commita6cf2f3d22a78aeae9d7f36cc78a195deb686705 (patch)
tree30a4c537185f3d6fd0fb435f6d981569d30b5e84 /test/test_set.rb
parente100fcbdd1e81c23e3b4c87964aff210232903a8 (diff)
downloadruby-a6cf2f3d22a78aeae9d7f36cc78a195deb686705.tar.gz
Make mutating the result of SortedSet#to_a not affect the set
Fixes [Bug #15834]
Diffstat (limited to 'test/test_set.rb')
-rw-r--r--test/test_set.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_set.rb b/test/test_set.rb
index 68ee7ce8a3..86f860222c 100644
--- a/test/test_set.rb
+++ b/test/test_set.rb
@@ -800,6 +800,9 @@ class TC_SortedSet < Test::Unit::TestCase
def test_sortedset
s = SortedSet[4,5,3,1,2]
+ a = s.to_a
+ assert_equal([1,2,3,4,5], a)
+ a << -1
assert_equal([1,2,3,4,5], s.to_a)
prev = nil