Levente Uzonyi uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ul.348.mcz==================== Summary ====================
Name: CollectionsTests-ul.348
Author: ul
Time: 19 January 2021, 1:29:30.901142 pm
UUID: 7a478e2d-0752-43f2-ab4a-4f6aa9f3bbe6
Ancestors: CollectionsTests-nice.347
- improved tests for OrderedCollection's #removeFirst: and #removeLast:.
=============== Diff against CollectionsTests-nice.347 ===============
Item was changed:
----- Method: OrderedCollectionTest>>testRemoveFirst (in category 'tests - removing') -----
testRemoveFirst
"Allows one to remove n element of a collection at the first"
"self run:#testRemoveFirst"
+ | c1 c2 |
- | c1 |
c1 := #(2 3 4 6) asOrderedCollection.
+ c2 := c1 copy.
+ self assert: Array empty equals: (c1 removeFirst: 0).
+ self assert: c2 equals: c1.
+ self assert: #(2) equals: (c1 removeFirst: 1).
+ self assert: #(3 4 6) asOrderedCollection equals: c1.
+ self assert:#(3 4) equals: (c1 removeFirst: 2).
+ self assert: #(6) asOrderedCollection equals: c1.
- c1 removeFirst: 1.
- self assert: (c1 = #(3 4 6) asOrderedCollection).
- c1 removeFirst: 2.
- self assert: (c1 = #(6) asOrderedCollection).
self should: [c1 removeFirst: 10] raise: Error.
!
Item was changed:
----- Method: OrderedCollectionTest>>testRemoveLast (in category 'tests - removing') -----
testRemoveLast
"Allows one to remove n element of a collection at the end"
"self run:#testRemoveLast"
+ | c1 c2 |
- | c1 |
c1 := #(2 3 4 6) asOrderedCollection.
+ c2 := c1 copy.
+ self assert: Array empty equals: (c1 removeLast: 0).
+ self assert: c2 equals: c1.
+ self assert: #(6) equals: (c1 removeLast: 1).
+ self assert: #(2 3 4) asOrderedCollection equals: c1.
+ self assert: #(3 4) equals: (c1 removeLast: 2).
+ self assert: #(2) asOrderedCollection equals: c1.
+ self should: [c1 removeLast: 10] raise: Error!
- c1 removeLast: 1.
- self assert: (c1 = #(2 3 4) asOrderedCollection).
- c1 removeLast: 2.
- self assert: (c1 = #(2) asOrderedCollection).
- self should: [c1 removeLast: 10] raise: Error.!