[Pkg] The Trunk: Tests-eem.151.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Apr 26 19:02:44 UTC 2012

Eliot Miranda uploaded a new version of Tests to project The Trunk:

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

Name: Tests-eem.151
Author: eem
Time: 26 April 2012, 12:02:22.807 pm
UUID: d1afe8a4-9721-4e74-a3f3-b2fc1057d51b
Ancestors: Tests-ul.150

Add tests for BlockClosure>isClean

=============== Diff against Tests-ul.150 ===============

Item was added:
+ ----- Method: ClosureTests>>testIsClean (in category 'testing') -----
+ testIsClean
+ 	| local |
+ 	local := #testIsClean.
+ 	self assert: [] isClean. "closes over nothing at all"
+ 	self assert: [:a :b| a < b] isClean. "accesses only arguments"
+ 	self assert: [:a :b| | s | s := a + b. s even] isClean. "accesses only local variables"
+ 	self deny: [^nil] isClean. "closes over home (^-return)"
+ 	self deny: [self] isClean. "closes over the receiver"
+ 	self deny: [collection] isClean. "closes over the receiver (to access the inst var collection)"
+ 	self deny: [local] isClean. "closes over local variable of outer context"!

More information about the Packages mailing list