Eliot Miranda uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-eem.283.mcz==================== Summary ====================
Name: KernelTests-eem.283
Author: eem
Time: 1 December 2014, 1:08:10.406 pm
UUID: ba98cc21-5dfb-4558-9cb5-8a6d58158ccd
Ancestors: KernelTests-eem.282
Fix methodClass test
=============== Diff against KernelTests-eem.282 ===============
Item was changed:
----- Method: CompiledMethodTest>>testMethodClass (in category 'tests - accessing') -----
testMethodClass
+ | method cls binding |
- | method cls |
method := self class >> #returnTrue.
self assert: #returnTrue equals: method selector.
"now make an orphaned method by just deleting the class.
+ old: #unknown
+ pre-environment semantics: return Obsolete class
+ environment semantics: return binding's value, which will be nil"
+ (Smalltalk classNamed: #TUTU) ifNotNil:
+ [Smalltalk removeClassNamed: #TUTU].
- old: #unknown
- new semantics: return Obsolete class"
- Smalltalk removeClassNamed: #TUTU.
cls := Object
subclass: #TUTU
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'KernelTests-Methods'.
cls compile: 'foo ^ 10'.
method := cls >> #foo.
+ binding := cls binding.
+ self assert: binding value equals: (Smalltalk classNamed: #TUTU) description: 'binding before class removal'.
+ self assert: (Smalltalk classNamed: #TUTU) equals: method methodClass description: 'methodClass before class removal'.
Smalltalk removeClassNamed: #TUTU.
+ self assert: binding value equals: method methodClass description: 'methodClass after class removal'.!
- self assert: cls equals: method methodClass description: 'methodClass after class removal'.!