[squeak-dev] The Inbox: CollectionsTests-fbs.190.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Aug 20 15:52:08 UTC 2012


Frank Shearar uploaded a new version of CollectionsTests to project The Inbox:
http://source.squeak.org/inbox/CollectionsTests-fbs.190.mcz

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

Name: CollectionsTests-fbs.190
Author: fbs
Time: 20 August 2012, 4:51:57.144 pm
UUID: 434a1777-9786-4203-b2a1-3ca8e9854eb1
Ancestors: CollectionsTests-ul.189

SequenceableCollection >> flatten turns a nested SequenceableCollection - a collection of collections of ... -  into a simple collection. Thus, #(1 (2 3) (4)) flatten = #(1 2 3 4).

=============== Diff against CollectionsTests-ul.189 ===============

Item was added:
+ ----- Method: SequenceableCollectionTest>>testFlattenFlattensRecursively (in category 'tests - copying') -----
+ testFlattenFlattensRecursively
+ 	self assert: #(1 2 3 4) equals: #(1 #(2 #(3) 4)) flatten.!

Item was added:
+ ----- Method: SequenceableCollectionTest>>testFlattenOfEmptyCollectionIsSelf (in category 'tests - copying') -----
+ testFlattenOfEmptyCollectionIsSelf
+ 	self assert: {} equals: {} flatten.!

Item was added:
+ ----- Method: SequenceableCollectionTest>>testFlattenOfFlatCollectionIsSelf (in category 'tests - copying') -----
+ testFlattenOfFlatCollectionIsSelf
+ 	self assert: #(1 2 3) equals: #(1 2 3) flatten.!

Item was added:
+ ----- Method: SequenceableCollectionTest>>testFlattenReturnsCopy (in category 'tests - copying') -----
+ testFlattenReturnsCopy
+ 	| a b |
+ 	a := Array with: 1 with: 2.
+ 	b := a flatten.
+ 	b at: 1 put: 3.
+ 	
+ 	self assert: #(1 2) equals: a.!



More information about the Squeak-dev mailing list