The Inbox: CollectionsTests-cmm.313.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: CollectionsTests-cmm.313.mcz

commits-2
Chris Muller uploaded a new version of CollectionsTests to project The Inbox:
http://source.squeak.org/inbox/CollectionsTests-cmm.313.mcz

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

Name: CollectionsTests-cmm.313
Author: cmm
Time: 4 June 2019, 4:54:40.961795 pm
UUID: f570a2c4-6e21-4241-8afb-2808173d3696
Ancestors: CollectionsTests-mt.311

Additional test for #joinSeparatedBy: describes the expected behavior for unordered collections.

=============== Diff against CollectionsTests-mt.311 ===============

Item was added:
+ ----- Method: CollectionTest>>testJoin (in category 'tests') -----
+ testJoin
+ | joined source |
+ self assert: #(a b c d e) join = 'abcde'.
+ self assert: (#(a b c) joinSeparatedBy: '|') = 'a|b|c'.
+ "Test with unordered Set."
+ source := #(a b c c b a x x x y z z z z z '1' '2' '3' '3' '2' '1') asSet.
+ joined := source joinSeparatedBy: '|'.
+ self assert: ((2 to: joined size by: 2) allSatisfy: [ : index | (joined at: index) = $| ]).
+ self assert: ((1 to: joined size by: 2) allSatisfy: [ : index | source includes: (joined at: index) asString ]).
+ "Repeat with Bag."
+ source := #(a b c c b a x x x y z z z z z '1' '2' '3' '3' '2' '1') asBag.
+ joined := source joinSeparatedBy: '|'.
+ self assert: ((2 to: joined size by: 2) allSatisfy: [ : index | (joined at: index) = $| ]).
+ self assert: ((1 to: joined size by: 2) allSatisfy: [ : index | source includes: (joined at: index) asString ]).
+ !

Item was removed:
- ----- Method: SequenceableCollectionTest>>testJoin (in category 'tests - converting') -----
- testJoin
-
- self assert: #(a b c d e) join = 'abcde'.
- self assert: (#(a b c) joinSeparatedBy: '|') = 'a|b|c'.!