File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
src/Containers-Array2D-Tests Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,39 @@ CTNewArray2DTest >> testFromRowsPad [
183183 self assert: (array atRow: 3 ) equals: #(6 0 0) .
184184]
185185
186+ { #category : ' tests' }
187+ CTNewArray2DTest >> testFromRowsPadNoPaddingNeeded [
188+ | array |
189+ array := self arrayClass fromRows: #( #(1 2) #(3 4) ) pad: 99 .
190+
191+ self assert: array width equals: 2 .
192+ self assert: array height equals: 2 .
193+ self assert: (array atRow: 1 ) equals: #(1 2) .
194+ self assert: (array atRow: 2 ) equals: #(3 4) .
195+ ]
196+
197+ { #category : ' tests' }
198+ CTNewArray2DTest >> testFromRowsPadWithCharacters [
199+ | array |
200+ array := self arrayClass fromRows: #( #($a $b) #($c) ) pad: $x.
201+
202+ self assert: array width equals: 2 .
203+ self assert: array height equals: 2 .
204+ self assert: (array atRow: 1 ) equals: #($a $b) .
205+ self assert: (array atRow: 2 ) equals: #($c $x) .
206+ ]
207+
208+ { #category : ' tests' }
209+ CTNewArray2DTest >> testFromRowsPadWithNil [
210+ | array |
211+ array := self arrayClass fromRows: #( #(1) #(2 3) ) pad: nil .
212+
213+ self assert: array width equals: 2 .
214+ self assert: array height equals: 2 .
215+ self assert: (array atRow: 1 ) equals: #(1 nil) .
216+ self assert: (array atRow: 2 ) equals: #(2 3) .
217+ ]
218+
186219{ #category : ' tests' }
187220CTNewArray2DTest >> testFromTopToBottomFromLeftToRightDo [
188221 |foo res |
You can’t perform that action at this time.
0 commit comments