2 testing UnitTests define: #SortedArray &parents: {UnitTests ExtensibleArray}.
4 tc@(UnitTests SortedArray traits) testIndexForInsertingAsLastElement
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
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.