[squeak-dev] The Trunk: CollectionsTests-ul.232.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 19 03:01:06 UTC 2015


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

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

Name: CollectionsTests-ul.232
Author: ul
Time: 19 January 2015, 4:00:23.595 am
UUID: a71e6150-de64-4b54-891d-8df2e78704d2
Ancestors: CollectionsTests-mt.231

- Fixed FloatCollectionTest >> #testAdd. #asArray returns an Array. #asFloatArray returns a FloatArray.
- Added a test for #groupsDo:.

=============== Diff against CollectionsTests-mt.231 ===============

Item was changed:
  ----- Method: FloatCollectionTest>>testAdd (in category 'tests') -----
  testAdd
  	| fc |
  	fc := #(1 2 3 4 ) as: FloatCollection.
  	fc add: 88.
+ 	self assert: #(1.0 2.0 3.0 4.0 88.0 ) asFloatArray equals: fc asFloatArray.
- 	self assert: fc asArray = #(1.0 2.0 3.0 4.0 88.0 ) asFloatArray.
  	fc add: 99.
+ 	self assert: (#(1 2 3 4 88 99 ) as: FloatCollection) equals: fc!
- 	self assert: fc = (#(1 2 3 4 88 99 ) as: FloatCollection)!

Item was added:
+ ----- Method: SequenceableCollectionTest>>testGroupsDo (in category 'tests - copying') -----
+ testGroupsDo
+ 
+ 	| array |
+ 	array := (1 to: 12) asArray.
+ 	self should: [ array groupsDo: [ ] ] raise: Error.
+ 	self assert: array equals: (Array streamContents: [ :stream |
+ 		array groupsDo: [ :each | stream nextPut: each ] ]).
+ 	self assert: #((1 2) (3 4) (5 6) (7 8) (9 10) (11 12)) equals: (Array streamContents: [ :stream |
+ 		array groupsDo: [ :a :b | 
+ 			stream nextPut: { a. b } ] ]).
+ 	self assert: #((1 2 3) (4 5 6) (7 8 9) (10 11 12)) equals: (Array streamContents: [ :stream |
+ 		array groupsDo: [ :a :b :c | 
+ 			stream nextPut: { a. b. c } ] ]).
+ 	self assert: #((1 2 3 4) (5 6 7 8) (9 10 11 12)) equals: (Array streamContents: [ :stream |
+ 		array groupsDo: [ :a :b :c :d | 
+ 			stream nextPut: { a. b. c. d } ] ]).
+ 	self assert: #((1 2 3 4 5) (6 7 8 9 10)) equals: (Array streamContents: [ :stream |
+ 		array groupsDo: [ :a :b :c :d :e | 
+ 			stream nextPut: { a. b. c. d. e } ] ]).
+ 	self assert: #((1 2 3 4 5 6) (7 8 9 10 11 12)) equals: (Array streamContents: [ :stream |
+ 		array groupsDo: [ :a :b :c :d :e :f | 
+ 			stream nextPut: { a. b. c. d. e. f } ] ]).
+ 	self assert: #((1 2 3 4 5 6 7)) equals: (Array streamContents: [ :stream |
+ 		array groupsDo: [ :a :b :c :d :e :f :g | 
+ 			stream nextPut: { a. b. c. d. e. f. g } ] ]).
+ 	self assert: #() equals: (Array streamContents: [ :stream |
+ 		#(1 2 3) groupsDo: [ :a :b :c :d | stream nextPut: { a. b. c. d } ] ])
+ 
+ !



More information about the Squeak-dev mailing list