Andreas Raab uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ul.98.mcz==================== Summary ====================
Name: CollectionsTests-ul.98
Author: ul
Time: 30 September 2009, 3:01:48 am
UUID: 71177639-1f4f-4947-b07b-4cb007d8e9c9
Ancestors: CollectionsTests-nice.97
- Dictionary shouldn't share associations in #select:
=============== Diff against CollectionsTests-nice.97 ===============
Item was changed:
----- Method: DictionaryTest>>testSelect (in category 'testing') -----
testSelect
"Ensure that Dictionary>>select: answers a dictionary not something else"
| dict expected result |
dict := Dictionary newFromPairs:{
#first. 1.
#second. 2.
#third. 3.
#fourth. 4.
#fifth. 5.
}.
result := dict select:[:each| each odd].
expected := Dictionary newFromPairs:{
#first. 1.
#third. 3.
#fifth. 5.
}.
+ self assert: result = expected.
+ result at: #first put: 0.
+ self assert: (dict at: #first) = 1 "No side effects"!
- self assert: result = expected.!