The Trunk: Tests-topa.307.mcz

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

The Trunk: Tests-topa.307.mcz

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

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

Name: Tests-topa.307
Author: topa
Time: 20 January 2015, 10:10:13.719 am
UUID: d5166f2b-dbec-49b7-ba75-87958543af4a
Ancestors: Tests-dtl.306

Environments: Don't break user code expecting the Dictionary API

=============== Diff against Tests-dtl.306 ===============

Item was added:
+ ----- Method: EnvironmentTest>>testAssociationsDo (in category 'compatibility tests') -----
+ testAssociationsDo
+ "For compatibility with legacy code, environments
+ should implement the dictionary protocol."
+
+ env at: #Griffle put: value.
+ env at: #Plonk put: value.
+ env at: #Nurp put: value.
+ env associationsDo: [:assoc |
+ (#(Smalltalk Undeclared) includes: assoc key)
+ ifFalse: ["We're not interested in these default bindings"
+ self assert: (#(Griffle Plonk Nurp) includes: assoc key).
+ self assert: value equals: assoc value]].
+ !

Item was added:
+ ----- Method: EnvironmentTest>>testKeysAndValuesDo (in category 'compatibility tests') -----
+ testKeysAndValuesDo
+ "For compatibility with legacy code, environments
+ should implement the dictionary protocol."
+
+ env at: #Griffle put: value.
+ env at: #Plonk put: value.
+ env at: #Nurp put: value.
+ env keysAndValuesDo: [:key :val |
+ (#(Smalltalk Undeclared) includes: key)
+ ifFalse: ["We're not interested in these default bindings"
+ self assert: (#(Griffle Plonk Nurp) includes: key).
+ self assert: value equals: val]].!

Item was added:
+ ----- Method: EnvironmentTest>>testValuesDo (in category 'compatibility tests') -----
+ testValuesDo
+ "For compatibility with legacy code, environments
+ should implement the dictionary protocol."
+
+ | count |
+ env at: #Griffle put: value.
+ env at: #Plonk put: value.
+ env at: #Nurp put: value.
+ count := 0.
+ env valuesDo: [:val | count := count + 1].
+ self assert: 3 + 2 equals: count description: '#valuesDo: should see all declared vallues plus the ones from Smalltalk and Undeclares'
+ !