diff options
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index a5b4735601..463701b846 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1152,6 +1152,16 @@ class TestArray < Test::Unit::TestCase assert_match(/reentered/, e.message, '[ruby-core:16679]') end + def test_sort_with_replace + xary = (1..100).to_a + 100.times do + ary = (1..100).to_a + ary.sort! {|a,b| ary.replace(xary); a <=> b} + GC.start + assert_equal(xary, ary, '[ruby-dev:34732]') + end + end + def test_to_a a = @cls[ 1, 2, 3 ] a_id = a.__id__ |