The Trunk: Tests-cwp.196.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-cwp.196.mcz

commits-2
Colin Putney uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-cwp.196.mcz

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

Name: Tests-cwp.196
Author: cwp
Time: 3 April 2013, 9:50:31.378 am
UUID: 21fbacb5-b2ee-45ab-b002-94a47b9ebf71
Ancestors: Tests-cwp.195

Add a test that ensures that assignments to globals evaluate to the value assigned, rather than the variable binding.

=============== Diff against Tests-cwp.195 ===============

Item was added:
+ ----- Method: EnvironmentTest>>storeValueMethod (in category 'running') -----
+ storeValueMethod
+ ^ 'doStore
+ | expr result |
+ expr := Object new.  
+ result := Plonk := expr.
+ ^ { expr. result }
+ '!

Item was added:
+ ----- Method: EnvironmentTest>>testStoreDomesticValue (in category 'compiling tests') -----
+ testStoreDomesticValue
+ | griffle values |
+ self createClass: #Griffle.
+ env at: #Plonk put: 'v1'.
+
+ griffle := env at: #Griffle.
+ griffle compile: self storeValueMethod.
+ values := griffle new doStore.
+
+ self assert: values isArray.
+ self assert: values size = 2.
+ self assert: values first == values last.
+ self assert: (env at: #Plonk) == values first!

Item was added:
+ ----- Method: EnvironmentTest>>testStoreImportedValue (in category 'compiling tests') -----
+ testStoreImportedValue
+ | griffle foreign values |
+ self createClass: #Griffle.
+ foreign := Environment withName: #Foreign.
+ foreign exportSelf.
+ foreign at: #Plonk put: 'v1'.
+ env from: foreign import: #Plonk.
+
+ griffle := env at: #Griffle.
+ griffle compile: self storeValueMethod.
+ values := griffle new doStore.
+
+ self assert: values isArray.
+ self assert: values size = 2.
+ self assert: values first == values last.
+ self assert: (foreign at: #Plonk) == values first!