The Trunk: CollectionsTests-ul.257.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-ul.257.mcz

commits-2
Levente Uzonyi uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ul.257.mcz

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

Name: CollectionsTests-ul.257
Author: ul
Time: 2 November 2015, 4:52:42.874 am
UUID: d6f5337b-2240-4afd-974b-21358e2f00b0
Ancestors: CollectionsTests-ul.256

WeakSet is an exception.

=============== Diff against CollectionsTests-ul.256 ===============

Item was changed:
  ----- Method: SetWithNilTest>>runSetWithNilTestOf: (in category 'tests') -----
  runSetWithNilTestOf: newSet
  "Run the common tests for the given set class"
+
+ | class collectClass |
+ class := newSet value class.
+ collectClass := class == WeakSet
+ ifTrue: [ WeakSet ]
+ ifFalse: [ Set ].
  self assert: (newSet value add: nil; yourself) size = 1.
  self assert: (newSet value addAll: #(nil nil nil); yourself) size = 1.
 
  self assert: ((newSet value add: nil; yourself) includes: nil).
  self assert: ((newSet value addAll: #(nil nil nil); yourself) includes: nil).
 
  self assert: (newSet value add: nil; yourself) anyOne = nil.
  self assert: ((newSet value add: nil; yourself) remove: nil) == nil.
  self assert: ((newSet value add: nil; yourself) remove: nil; yourself) isEmpty.
 
  self assert: (newSet value addAll: #(1 nil foo); yourself) size = 3.
  self assert: ((newSet value addAll: #(1 nil foo); yourself) remove: nil; yourself) size = 2.
 
+ self assert: ((newSet value add: nil; yourself) collect:[:x| x]) = (collectClass with: nil).
- self assert: ((newSet value add: nil; yourself) collect:[:x| x]) = (Set with: nil).
  self assert: ((newSet value add: nil; yourself) collect:[:x| x] as: Array) = #(nil).
 
  self deny: ((newSet value) includes: nil).
  self deny: ((newSet value add: 3; yourself) includes: nil).
  self deny: ((newSet value add: 3; remove: 3; yourself) includes: nil).
  !