The Trunk: CollectionsTests-mt.311.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-mt.311.mcz

commits-2
Marcel Taeumel uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-mt.311.mcz

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

Name: CollectionsTests-mt.311
Author: mt
Time: 14 May 2019, 9:51:44.138441 am
UUID: 5c25d86f-dbd9-a249-b28a-2ec31ebe2d3d
Ancestors: CollectionsTests-mt.310

Fixes some comments and extends test for #any: on streams.

=============== Diff against CollectionsTests-mt.310 ===============

Item was changed:
  ----- Method: CollectionTest>>testAnyAs (in category 'tests') -----
  testAnyAs
 
  {
+ "{ numberOfElements. expectedSize. resultKind. originalCollection }"
- "{ numberOfElements. originalCollection }"
  { 2. 2. OrderedCollection. Array withAll: #(1 2 3 4) }.
  { 4. 1. Set. Array withAll: #(1 1 1 1) }.
  { 4. 4. Bag. Array withAll: #(1 1 1 1) }.
  { 2. 2. Dictionary. Array withAll: { #apple -> #red. #plum -> #purple. #peach -> #orange } }.
  } do: [:spec | | result |
  result := spec fourth any: spec first as: spec third.
 
  "For Array vs. Dictionary, #includesAllOf: does not work because it would just iterate the values in the dictionary."
  (result associationsDo: [:each | self assert: (spec fourth includes: each)]).
 
  self
  assert: spec second equals: result size;
  assert: spec third equals: result class].!

Item was changed:
  ----- Method: CollectionTest>>testAnyStreams (in category 'tests') -----
  testAnyStreams
 
  {
+ "{ numberOfElements. expectedSize. originalCollection }"
+ { 2. 2. Array withAll: #(1 2 3 4) }.
+ { 4. 4. Array withAll: #(1 2 3 4) }.
+ { 0. 0. Array withAll: #(1 2 3 4) }.
+ { 10. 4. Array withAll: #(1 2 3 4) }. "No error for streams."
+ { 2. 2. OrderedCollection withAll: #(1 2 3 4) }.
- "{ numberOfElements. originalCollection }"
- { 2. Array withAll: #(1 2 3 4) }.
- { 4. Array withAll: #(1 2 3 4) }.
- { 0. Array withAll: #(1 2 3 4) }.
- { 2. OrderedCollection withAll: #(1 2 3 4) }.
  } do: [:spec | | result |
+ result := spec third readStream any: spec first.
- result := spec second readStream any: spec first.
  self
+ assert: (spec third includesAllOf: result);
+ assert: spec second equals: result size;
+ assert: spec third class equals: result class].!
- assert: (spec second includesAllOf: result);
- assert: spec first equals: result size;
- assert: spec second class equals: result class].!