--- a/RegressionTests__CollectionTests.st Thu Apr 12 21:11:11 2012 +0200
+++ b/RegressionTests__CollectionTests.st Sat Apr 14 20:01:29 2012 +0200
@@ -546,6 +546,29 @@
sorted := data copy mergeSort:[:a :b| a < b].
self checkSorted:sorted with:checkBlock against:data.
].
+!
+
+testOrderedCollection07_HeapSortRandomCollection
+ |data sorted rg checkBlock|
+
+ checkBlock := [:a :b| a <= b].
+ rg := Random new.
+
+ #(1 4 11 2000 20011 200000) do:[:eachSize|
+ data := Array new:eachSize.
+ 1 to:data size do:[:i |
+ data at:i put:(rg nextIntegerBetween:1 and:100).
+ ].
+ sorted := data copy heapSort.
+ self checkSorted:sorted with:checkBlock against:data.
+ sorted := sorted heapSort.
+ self checkSorted:sorted with:checkBlock against:data.
+ sorted := sorted reverse heapSort.
+ self checkSorted:sorted with:checkBlock against:data.
+
+ sorted := data copy heapSort:[:a :b| a < b].
+ self checkSorted:sorted with:checkBlock against:data.
+ ].
! !
!CollectionTests methodsFor:'tests-orderedDictionary'!