1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_array.rb: do not assume stable sort

* test/ruby/test_array.rb (test_sort_bang_with_freeze): make a
  clone to copy a <=> singleton method, instead of dup.  which
  element will be called is not predictable.
  [ruby-core:76088] [Bug #12509]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-10-12 15:39:10 +00:00
parent 9d8f62d55e
commit 89230e7ca3
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,10 @@
Thu Oct 13 00:39:08 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/ruby/test_array.rb (test_sort_bang_with_freeze): make a
clone to copy a <=> singleton method, instead of dup. which
element will be called is not predictable.
[ruby-core:76088] [Bug #12509]
Thu Oct 13 00:21:27 2016 Simon Soriano <simon0191@gmail.com> Thu Oct 13 00:21:27 2016 Simon Soriano <simon0191@gmail.com>
* doc/extension.rdoc: Replace "You can defined hooked variables" * doc/extension.rdoc: Replace "You can defined hooked variables"

View file

@ -1488,7 +1488,7 @@ class TestArray < Test::Unit::TestCase
1 1
} }
} }
o2 = o1.dup o2 = o1.clone
ary << o1 << o2 ary << o1 << o2
orig = ary.dup orig = ary.dup
assert_raise(RuntimeError, "frozen during comparison") {ary.sort!} assert_raise(RuntimeError, "frozen during comparison") {ary.sort!}