The Trunk: CollectionsTests-ul.158.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.158.mcz

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

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

Name: CollectionsTests-ul.158
Author: ul
Time: 21 March 2010, 5:53:04.99 pm
UUID: 16507503-b2db-6f45-8aee-f71f54912f2b
Ancestors: CollectionsTests-ul.157

- don't use SequenceableCollection >> #reverse

=============== Diff against CollectionsTests-ul.157 ===============

Item was changed:
  ----- Method: OrderedCollectionTest>>testAddAfterIndex (in category 'testing-public methods') -----
  testAddAfterIndex
  "self run: #testAddAfterIndex"
  | l |
  l := #(1 2 3 4) asOrderedCollection.
  l add: 77 afterIndex: 0.
  self assert: (l =  #(77 1 2 3 4) asOrderedCollection).
  l add: 88 afterIndex: 2.
  self assert: (l =  #(77 1 88 2 3 4) asOrderedCollection).
  l add: 99 afterIndex: l size.
  self assert: (l =  #(77 1 88 2 3 4 99) asOrderedCollection).
  self should:[l add: 666 afterIndex: -1] raise: Error.
  self should:[l add: 666 afterIndex: l size+1] raise: Error.
 
  "Now make room by removing first two and last two elements,
  and see if the illegal bounds test still fails"
+ (l first: 2) , (l last: 2) reversed do: [:e | l remove: e].
- (l first: 2) , (l last: 2) reverse do: [:e | l remove: e].
  self should: [l add: 666 afterIndex: -1] raise: Error.
  self should: [l add: 666 afterIndex: l size+1] raise: Error.!

Item was changed:
  ----- Method: OrderedCollectionTest>>testAddBeforeIndex (in category 'testing-public methods') -----
  testAddBeforeIndex
  "self run: #testAddBeforeIndex"
  | l |
  l := #(1 2 3 4) asOrderedCollection.
  l add: 77 beforeIndex: 1.
  self assert: (l =  #(77 1 2 3 4) asOrderedCollection).
  l add: 88 beforeIndex: 3.
  self assert: (l =  #(77 1 88 2 3 4) asOrderedCollection).
  l add: 99 beforeIndex: l size+1.
  self assert: (l =  #(77 1 88 2 3 4 99) asOrderedCollection).
  self should:[l add: 666 beforeIndex: 0] raise: Error.
  self should:[l add: 666 beforeIndex: l size+2] raise: Error.
 
  "Now make room by removing first two and last two elements,
  and see if the illegal bounds test still fails"
+ (l first: 2) , (l last: 2) reversed do: [:e | l remove: e].
- (l first: 2) , (l last: 2) reverse do: [:e | l remove: e].
  self should:[l add: 666 beforeIndex: 0] raise: Error.
  self should:[l add: 666 beforeIndex: l size+2] raise: Error.
 
  !