The Inbox: CollectionsTests-ct.348.mcz

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

The Inbox: CollectionsTests-ct.348.mcz

commits-2
A new version of CollectionsTests was added to project The Inbox:
http://source.squeak.org/inbox/CollectionsTests-ct.348.mcz

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

Name: CollectionsTests-ct.348
Author: ct
Time: 24 January 2021, 4:55:30.561273 pm
UUID: 342ca023-4467-d741-b42a-924ae0a72936
Ancestors: CollectionsTests-mt.346

Tests Collections-ct.921 (inbox, Dictionary newFromKeys:values:).

=============== Diff against CollectionsTests-mt.346 ===============

Item was added:
+ ----- Method: DictionaryTest>>testNewFromKeysValues (in category 'tests - basic') -----
+ testNewFromKeysValues
+
+ | actual expected |
+ actual := Dictionary
+ newFromKeys: #(2 3 1)
+ values: #(4 5 6).
+ expected := Dictionary new
+ at: 2 put: 4;
+ at: 3 put: 5;
+ at: 1 put: 6;
+ yourself.
+
+ self assert: expected equals: actual.!

Item was added:
+ ----- Method: DictionaryTest>>testNewFromPairs (in category 'tests - basic') -----
+ testNewFromPairs
+
+ | actual expected |
+ actual := Dictionary newFromPairs: {
+ #one. 'foo'.
+ #two. 2 @ 3 }.
+ expected := Dictionary new
+ at: #one put: 'foo';
+ at: #two put: 2 @ 3;
+ yourself.
+
+ self assert: expected equals: actual.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: CollectionsTests-ct.348.mcz

marcel.taeumel
What happens when the collection for keys as a different size than values? Should there be an error? A test could document that behavior. :-)

Best,
Marcel

Am 24.01.2021 16:55:37 schrieb [hidden email] <[hidden email]>:

A new version of CollectionsTests was added to project The Inbox:
http://source.squeak.org/inbox/CollectionsTests-ct.348.mcz

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

Name: CollectionsTests-ct.348
Author: ct
Time: 24 January 2021, 4:55:30.561273 pm
UUID: 342ca023-4467-d741-b42a-924ae0a72936
Ancestors: CollectionsTests-mt.346

Tests Collections-ct.921 (inbox, Dictionary newFromKeys:values:).

=============== Diff against CollectionsTests-mt.346 ===============

Item was added:
+ ----- Method: DictionaryTest>>testNewFromKeysValues (in category 'tests - basic') -----
+ testNewFromKeysValues
+
+ | actual expected |
+ actual := Dictionary
+ newFromKeys: #(2 3 1)
+ values: #(4 5 6).
+ expected := Dictionary new
+ at: 2 put: 4;
+ at: 3 put: 5;
+ at: 1 put: 6;
+ yourself.
+
+ self assert: expected equals: actual.!

Item was added:
+ ----- Method: DictionaryTest>>testNewFromPairs (in category 'tests - basic') -----
+ testNewFromPairs
+
+ | actual expected |
+ actual := Dictionary newFromPairs: {
+ #one. 'foo'.
+ #two. 2 @ 3 }.
+ expected := Dictionary new
+ at: #one put: 'foo';
+ at: #two put: 2 @ 3;
+ yourself.
+
+ self assert: expected equals: actual.!