The Trunk: CollectionsTests-topa.282.mcz

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

The Trunk: CollectionsTests-topa.282.mcz

commits-2
Tobias Pape uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-topa.282.mcz

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

Name: CollectionsTests-topa.282
Author: topa
Time: 14 October 2017, 1:29:21.227418 pm
UUID: ae84234a-b742-4e29-8213-2001111e4815
Ancestors: CollectionsTests-pre.281

tests for #inititializedInstance and #empty for certain collections

=============== Diff against CollectionsTests-pre.281 ===============

Item was added:
+ ----- Method: ArrayTest>>testEmpty (in category 'testing') -----
+ testEmpty
+
+ self
+ assert: 0
+ equals: Array empty size
+ description: 'The empty Array should be empty indeed';
+
+ assert: Array
+ equals: Array empty species
+ description: 'The empty Array should be an Array';
+
+ assert: Array empty
+ identical: Array empty
+ description: 'The empty Array should be canonical';
+
+ yourself
+
+
+ !

Item was added:
+ ----- Method: ByteArrayTest>>testEmpty (in category 'testing') -----
+ testEmpty
+
+ self
+ assert: 0
+ equals: ByteArray empty size
+ description: 'The empty ByteArray should be empty indeed';
+
+ assert: ByteArray
+ equals: ByteArray empty species
+ description: 'The empty ByteArray should be a ByteArray';
+
+ assert: ByteArray empty
+ identical: ByteArray empty
+ description: 'The empty ByteArray should be canonical';
+
+ yourself
+
+
+ !

Item was added:
+ ----- Method: CollectionTest>>testEmptyOfLiteralCollections (in category 'tests') -----
+ testEmptyOfLiteralCollections
+
+ | literalCollections |
+ literalCollections := Collection withAllSubclasses select:
+ [:cls | cls initializedInstance ifNil: [false] ifNotNil: [:inst | inst isLiteral]].
+ literalCollections do: [:coll |
+ self
+ assert: 0
+ equals: coll empty size
+ description: 'Literal collection should have meaningful empty instance';
+
+ assert: coll empty species
+ identical: coll empty species
+ description: 'Empty instance of literal collection should be canonical']!

Item was added:
+ ----- Method: CollectionTest>>testInitializedInstanceIntegrity (in category 'tests') -----
+ testInitializedInstanceIntegrity
+
+ self
+ shouldnt: [Collection withAllSubclassesDo: [:cls | cls initializedInstance]]
+ raise: Error
+ description: 'No collection should break for #initializedInstance';
+
+ assert: [Collection withAllSubclasses allSatisfy: [:cls | |inst|
+ inst := cls initializedInstance.
+ inst isNil or: [inst isKindOf: cls]]]
+ description: 'All collections should have meaningful initialized instances or opted out';
+
+ yourself
+ !

Item was added:
+ ----- Method: StringTest>>testEmpty (in category 'testing') -----
+ testEmpty
+
+ self
+ assert: 0
+ equals: String empty size
+ description: 'The empty String should be empty indeed';
+
+ assert: String new species
+ equals: String empty species
+ description: 'The empty String should be a String';
+
+ assert: String empty
+ identical: String empty
+ description: 'The empty String should be canonical';
+
+ yourself
+
+
+ !