X Tutup
Skip to content

Commit 1d8daee

Browse files
author
Johan Brichau
committed
make thisContext test work for Squeak
1 parent 74f54ab commit 1d8daee

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

repository/Grease-Core.package/GRPlatform.class/instance/version.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ version info
22
version
33
"Answer the Grease version"
44

5-
^ (GRVersion major: 1 minor: 8 revision: 2)
5+
^ (GRVersion major: 1 minor: 9 revision: 0)
66
yourself
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
tests
22
testThisContext
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

Comments
 (0)
X Tutup