[Pkg] The Trunk: CollectionsTests-ul.303.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 22 11:09:39 UTC 2019


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 ]!



More information about the Packages mailing list