mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c (rb_ary_sort_bang): should not free shared pointer, and set
shared. [ruby-dev:34732] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
02838f3508
commit
9afd5465e2
3 changed files with 17 additions and 1 deletions
|
@ -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__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue