[squeak-dev] The Inbox: CollectionsTests-ct.348.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Jan 25 11:09:55 UTC 2021


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 commits at source.squeak.org <commits at source.squeak.org>:
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.!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210125/77a1cd67/attachment.html>


More information about the Squeak-dev mailing list