Removed long-since defunct LLVM bootstrap code. Any LLVM strategy will have to be...
[cslatevm.git] / tests / sorted.slate
blob5211d86f8324a4bc5027243d346b586ded679290
2 testing UnitTests define: #SortedArray &parents: {UnitTests ExtensibleArray}.
4 tc@(UnitTests SortedArray traits) testIndexForInsertingAsLastElement
5 [| se insertIndex |
6   se: SortedArray new.
7   insertIndex: (se indexForInserting: 1). 
8   tc assert: insertIndex = 0 description: 'Empty SortedArray should insert to 0.'.
9   se at: insertIndex insert: 1.
10   2 upTo: 10 do: [| :ind insertAt |
11     insertAt: (se indexForInserting: ind).
12     tc assert: insertAt = (ind - 1) 
13       description: 'SortedArray should maintain sort order for: ' ; (ind as: String).
14     se at: insertAt insert: 1].
17 tc@(UnitTests SortedArray traits) testAddByInsert
18 [| se |
19   se: SortedArray new.
20   0 below: 10 do: [| :ind | se add: ind + 1].
21   tc assert: se size = 10 description: '#add: should increase size.'.
24 tc@(UnitTests SortedArray traits) suite
26   tc suiteForSelectors: {
27     #testIndexForInsertingAsLastElement.
28     #testAddByInsert
29   }