Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
switch default inspect to use #view; add new (failing) test TDStackFr…
…ameNewTests>>testNestedBlockTempsAndArgsWithComplexOverride
- Loading branch information
1 parent
89e7884
commit 5679e2f
Showing
7 changed files
with
73 additions
and
16 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...ackage/TDStackFrameNewTests.class/instance/nestedBlockTempsAndArgsWithComplexOverride..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
block methods | ||
nestedBlockTempsAndArgsWithComplexOverride: arg1 | ||
| a b c d e f block | | ||
a := 1. | ||
b := 2. | ||
c := 3. | ||
d := 4. | ||
e := 5. | ||
f := 6. | ||
block := [ | c d | | ||
c := 13. | ||
d := 14. | ||
1 to: 3 do: [ :index | f := index ]. | ||
[ | d e | | ||
e := 25. | ||
self halt ] value ] value. | ||
block value |
44 changes: 44 additions & 0 deletions
44
...age/TDStackFrameNewTests.class/instance/testNestedBlockTempsAndArgsWithComplexOverride.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
tests | ||
testNestedBlockTempsAndArgsWithComplexOverride | ||
| frames homeMethod blockFrame theContext frameMap x nestedValueMap selector | | ||
nestedValueMap := Dictionary new | ||
at: 'a' put: 1; | ||
at: 'arg1' put: 3; | ||
at: 'b' put: 2; | ||
at: 'block' put: nil; | ||
at: 'c' put: 13; | ||
at: 'd' put: TDTodeExpandedContext noValueMarker; | ||
at: 'index' put: 3; | ||
at: 'f' put: 3; | ||
yourself. | ||
selector := #'nestedBlockTempsAndArgsWithComplexOverride:'. | ||
homeMethod := self compiledMethodAt: selector. | ||
[ self perform: selector with: 3 ] | ||
on: Halt | ||
do: [ :ex | self halt. | ||
frames := self createFrames ]. | ||
blockFrame := frames first | ||
findFrameSuchThat: [ :frame | frame homeMethod == homeMethod ]. | ||
theContext := blockFrame thisContext. | ||
frameMap := blockFrame syntheticFrameMap. | ||
self assert: blockFrame nestedArgAndTempVarNamesMap size = nestedValueMap size. | ||
self assert: blockFrame argAndTempNames size = 2. | ||
self assert: frameMap size == 1. | ||
nestedValueMap keysAndValuesDo: [ :key :value | self | ||
assert: | ||
(x := blockFrame nestedArgOrTempNamed: key ifAbsent: [ self assert: false ]) | ||
== value ]. | ||
self | ||
assert: | ||
(x := blockFrame argOrTempNamed: 'e' ifAbsent: [ self assert: false ]) == 1. | ||
self | ||
assert: | ||
(x := blockFrame objectFor: 'self' ifAbsent: [ self assert: false ]) == nil. | ||
self | ||
assert: | ||
(x := blockFrame objectFor: '(thisContext)' ifAbsent: [ self assert: false ]) | ||
== theContext. | ||
self | ||
validateThisContextWithHomeContext: theContext | ||
frame: blockFrame | ||
home: homeMethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
repository/Tode-GemStone-Server3x-Tests.package/monticello.meta/version
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.