11tests
22testThisContext
3- | methodContext block |
3+ | methodContext block ctx |
4+ " This is just a basic test to see if thisContext works"
45 methodContext := self platform thisContext.
56 block := [ | blockContext |
6- blockContext := self platform thisContext.
7- self assert: blockContext sender = methodContext.
8- " The following is a difference between Gemstone and Pharo... "
9- (Smalltalk includesKey: #GRGemStonePlatform )
10- ifTrue: [ self assert: blockContext receiver = block ]
11- ifFalse: [
12- self assert: blockContext receiver = self .
13- self assert: (blockContext tempNamed: ' blockContext' ) == blockContext ].
14- self assert: (blockContext tempNamed: ' methodContext' ) == methodContext ].
7+ blockContext := self platform thisContext.
8+ self assert: blockContext sender = methodContext.
9+ " The following is a difference between Gemstone and Pharo... "
10+ (Smalltalk includesKey: #GRGemStonePlatform )
11+ ifTrue: [ self assert: blockContext receiver = block ]
12+ ifFalse: [
13+ self assert: blockContext receiver = self .
14+ (blockContext respondsTo: #tempNamed: )
15+ ifTrue: [ self assert: (blockContext tempNamed: ' blockContext' ) == blockContext ]
16+ ifFalse: [ self assert: (blockContext namedTempAt: (blockContext tempNames indexOf: #blockContext )) == blockContext ] ].
17+ (blockContext respondsTo: #tempNamed: )
18+ ifTrue: [ self assert: (blockContext tempNamed: ' methodContext' ) == methodContext ]
19+ ifFalse: [ self assert: (blockContext namedTempAt: (blockContext tempNames indexOf: #methodContext )) == methodContext ] ].
20+
1521 block value.
1622 self assert: self returnSender = methodContext.
1723 self assert: methodContext receiver = self .
18- self assert: (self platform thisContext tempNamed: ' block' ) == block
24+ ctx := self platform thisContext.
25+ (ctx respondsTo: #tempNamed: )
26+ ifTrue: [ self assert: (ctx tempNamed: ' block' ) == block ]
27+ ifFalse: [ self assert: (ctx namedTempAt: (ctx tempNames indexOf: #block )) == block ]
0 commit comments