The Trunk: CollectionsTests-nice.169.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-nice.169.mcz

commits-2
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.169.mcz

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

Name: CollectionsTests-nice.169
Author: nice
Time: 21 August 2010, 4:31:17.463 pm
UUID: 35ed6fa6-1300-43ce-acf4-9291cb65825e
Ancestors: CollectionsTests-ar.168

Add test from http://bugs.squeak.org/view.php?id=6943
Fix Heap sortBlock test, since equality with an Array is no more possible.

Remove equality tests with Interval.
This just happened to be casually true, but I doubt this ever was an intentional feature.

=============== Diff against CollectionsTests-ar.168 ===============

Item was added:
+ ----- Method: HeapTest>>testIfEqualIsAssociative (in category 'testing') -----
+ testIfEqualIsAssociative
+ "This is http://bugs.squeak.org/view.php?id=6943"
+
+     | anArray heap1 heap2 |
+     anArray := #(1 2 3).
+     heap1 := Heap withAll: (1 to: 3) sortBlock: [:a :b | a < b].
+     heap2 := Heap withAll: (1 to: 3) sortBlock: [:a :b | b > a].
+     self
+ assert: (heap1 = anArray) & (heap2 = anArray) ==> (heap1 = heap2)
+ description: 'Heap equality should be transitive'!

Item was changed:
  ----- Method: HeapTest>>testSortBlock (in category 'basic tests') -----
  testSortBlock
  "self run: #testSortBlock"
 
  | heap |
  heap := Heap withAll: #(1 3 5).
+ self assert: heap asArray = #(1 3 5).
- self assert: heap = #(1 3 5).
 
  heap sortBlock: [ :e1 :e2 | e1 >= e2 ].
+ self assert: heap asArray = #(5 3 1)
- self assert: heap = #(5 3 1)
  !

Item was removed:
- ----- Method: IntervalTest>>testEquals6 (in category 'tests') -----
- testEquals6
-
- self assert: #() = Heap new.
- self assert: #(3 5) = (Heap withAll: #(3 5)).
- self deny: (3 to: 5 by: 2) = (Heap withAll: #(3 4 5)).
- self deny: (3 to: 5 by: 2) = Heap new.
-
- self assert: Heap new = #().
- self assert: (Heap withAll: #(3 5)) = #(3 5).
- self deny: (Heap withAll: #(3 4 5)) = #(3 5).
- self deny: Heap new = #(3 5).!

Item was removed:
- ----- Method: IntervalTest>>testEquals5 (in category 'tests') -----
- testEquals5
-
- self assert: (3 to: 5 by: 2) = (Heap withAll: #(3 5)).
- self deny: (3 to: 5 by: 2) = (Heap withAll: #(3 4 5)).
- self deny: (3 to: 5 by: 2) = Heap new.
-
- self assert: (Heap withAll: #(3 5)) = (3 to: 5 by: 2).
- self deny: (Heap withAll: #(3 4 5)) = (3 to: 5 by: 2).
- self deny: Heap new = (3 to: 5 by: 2).!