Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unimplemented pragma #80

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions src/Sindarin-Tests/SindarinDebuggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ SindarinDebuggerTest >> testChangingPcKeepsSameStateAndPushesCorrectElementsOnSt
{ #category : #tests }
SindarinDebuggerTest >> testChangingPcRaisesErrorWhenPcIsGreaterThanEndPC [

<ignoreNotImplementedSelectors: #( #helperMethod1 )>
| oldPC sdbg |
sdbg := SindarinDebugger debug: [ self helperMethod1 ].
sdbg
Expand All @@ -368,24 +369,25 @@ SindarinDebuggerTest >> testChangingPcRaisesErrorWhenPcIsGreaterThanEndPC [
{ #category : #tests }
SindarinDebuggerTest >> testChangingPcRaisesErrorWhenPcIsLowerThanInitialPC [

<ignoreNotImplementedSelectors: #( #helperMethod1 )>
| scdbg |
scdbg := SindarinDebugger debug: [ self helperMethod1 ].

scdbg
step;
stepOver;
stepOver.

self shouldnt: [ scdbg pc: scdbg method initialPC ] raise: NotValidPcError.

scdbg := SindarinDebugger debug: [ self helperMethod1 ].

scdbg
step;
stepOver;
stepOver.

self should: [ scdbg pc: scdbg method initialPC - 1 ] raise: NotValidPcError.
self should: [ scdbg pc: scdbg method initialPC - 1 ] raise: NotValidPcError
]

{ #category : #tests }
Expand All @@ -410,6 +412,8 @@ SindarinDebuggerTest >> testChangingPcToNonExistingBytecodeOffsetGoesToPreviousP

{ #category : #tests }
SindarinDebuggerTest >> testContext [

<ignoreNotImplementedSelectors: #( helperMethod15 )>
| scdbg |
scdbg := SindarinDebugger debug: [ self helperMethod15 ].
self assert: scdbg context equals: scdbg debugSession interruptedContext.
Expand Down Expand Up @@ -689,6 +693,7 @@ SindarinDebuggerTest >> testMoveToNodeKeepsStackWhenAimedNodeIsMethodNode [
{ #category : #tests }
SindarinDebuggerTest >> testMoveToNodeKeepsStackWhenAimedNodeIsMethodNodeThatDoesNotHaveAssociatedPC [

<ignoreNotImplementedSelectors: #( helperMethod1 )>
| scdbg newPc newNode realPC realNode |
scdbg := SindarinDebugger debug: [ self helperMethod1 ].

Expand All @@ -708,14 +713,13 @@ SindarinDebuggerTest >> testMoveToNodeKeepsStackWhenAimedNodeIsMethodNodeThatDoe
realNode := scdbg node.

self assert: scdbg pc equals: scdbg method endPC.
self
assert: scdbg node
identicalTo: (scdbg methodNode sourceNodeForPC: scdbg pc)
self assert: scdbg node identicalTo: (scdbg methodNode sourceNodeForPC: scdbg pc)
]

{ #category : #tests }
SindarinDebuggerTest >> testMoveToNodeRaisesErrorWhenNodeIsNotIdenticalToANodeInMethod [

<ignoreNotImplementedSelectors: #( #helperMethod1 )>
| oldNode sdbg aimedNode |
sdbg := SindarinDebugger debug: [ self helperMethod1 ].
sdbg
Expand All @@ -736,14 +740,14 @@ SindarinDebuggerTest >> testMoveToNodeRaisesErrorWhenNodeIsNotIdenticalToANodeIn
stepOver.
oldNode := sdbg node.
self
should: [ sdbg moveToNode: (RBLiteralValueNode value: 1) ]
raise: NodeNotInASTError;
should: [ sdbg moveToNode: (RBLiteralValueNode value: 1) ] raise: NodeNotInASTError;
assert: sdbg node equals: oldNode
]

{ #category : #tests }
SindarinDebuggerTest >> testMoveToNodeRaisesErrorWhenNodeIsNotInMethod [

<ignoreNotImplementedSelectors: #( helperMethod1 )>
| oldNode sdbg |
sdbg := SindarinDebugger debug: [ self helperMethod1 ].
sdbg
Expand All @@ -752,8 +756,7 @@ SindarinDebuggerTest >> testMoveToNodeRaisesErrorWhenNodeIsNotInMethod [
stepOver.
oldNode := sdbg node.
self
shouldnt: [ sdbg moveToNode: sdbg methodNode statements last ]
raise: NodeNotInASTError;
shouldnt: [ sdbg moveToNode: sdbg methodNode statements last ] raise: NodeNotInASTError;
deny: sdbg node equals: oldNode.
sdbg := SindarinDebugger debug: [ self helperMethod1 ].
sdbg
Expand All @@ -762,8 +765,7 @@ SindarinDebuggerTest >> testMoveToNodeRaisesErrorWhenNodeIsNotInMethod [
stepOver.
oldNode := sdbg node.
self
should: [ sdbg moveToNode: (RBLiteralValueNode value: 2) ]
raise: NodeNotInASTError;
should: [ sdbg moveToNode: (RBLiteralValueNode value: 2) ] raise: NodeNotInASTError;
assert: sdbg node equals: oldNode
]

Expand Down Expand Up @@ -1738,26 +1740,24 @@ SindarinDebuggerTest >> testStatementNodeContaining [
{ #category : #tests }
SindarinDebuggerTest >> testStatementNodeContainingReturnsStatementNodeThatContainsTheIdenticalSubtree [

<ignoreNotImplementedSelectors: #( helperMethod1 )>
| sdbg |
sdbg := SindarinDebugger debug: [ self helperMethod1 ].
sdbg step.

"1 is in the tree but it should return its parent only if we provide the exact literal node"
self
should: [ sdbg statementNodeContaining: (RBLiteralNode value: 1) ]
raise: NodeNotInASTError
self should: [ sdbg statementNodeContaining: (RBLiteralNode value: 1) ] raise: NodeNotInASTError
]

{ #category : #tests }
SindarinDebuggerTest >> testStatementNodeContainingWhenNodeIsNotInAST [

<ignoreNotImplementedSelectors: #( helperMethod1 )>
| sdbg |
sdbg := SindarinDebugger debug: [ self helperMethod1 ].
sdbg step.

self
should: [ sdbg statementNodeContaining: (RBLiteralNode value: 2) ]
raise: NodeNotInASTError
self should: [ sdbg statementNodeContaining: (RBLiteralNode value: 2) ] raise: NodeNotInASTError
]

{ #category : #tests }
Expand Down