The Trunk: CollectionsTests-ul.303.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: CollectionsTests-ul.303.mcz

commits-2
Levente Uzonyi uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ul.303.mcz

==================== Summary ====================

Name: CollectionsTests-ul.303
Author: ul
Time: 22 March 2019, 12:06:57.507166 pm
UUID: 123e456a-6318-4bb6-8a3b-4e22b7492eb0
Ancestors: CollectionsTests-pre.302

Added a test for the Heap bug fixed in Collections-ul.823.

=============== Diff against CollectionsTests-pre.302 ===============

Item was added:
+ ----- Method: HeapTest>>testIndexUpdateBlockWithFirstElementRemoval (in category 'tests') -----
+ testIndexUpdateBlockWithFirstElementRemoval
+
+ | random heap validateHeap |
+ random := Random seed: 36rSqueak.
+ heap := Heap sortBlock: [ :a :b | a first <= b first ].
+ heap indexUpdateBlock: [ :element :newIndex | element at: 2 put: newIndex ].
+ validateHeap := [
+ heap isHeap
+ and: [ heap isValidHeap
+ and: [ heap do: [ :each | self assert: (heap at: each second) == each ] ] ] ].
+ validateHeap value.
+ 1 to: 10 do: [ :i |
+ heap add: { i. nil }.
+ validateHeap value ].
+ 10 timesRepeat: [
+ heap removeAt: 1.
+ validateHeap value ]!