Skip to content

Commit

Permalink
Update tests with the fixed step-over behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaRanasinghe committed Nov 10, 2024
1 parent cb2e789 commit 06e7fa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,8 @@ public void breakpointInBetweenStepOverTest() throws BallerinaTestException {
debugTestRunner.initDebugSession(DebugUtils.DebuggeeExecutionKind.RUN);
Pair<BallerinaTestDebugPoint, StoppedEventArguments> debugHitInfo = debugTestRunner.waitForDebugHit(25000);

// Debugger should hit the breakpoint inside the function invocation when trying to step over.
debugTestRunner.resumeProgram(debugHitInfo.getRight(), DebugTestRunner.DebugResumeKind.STEP_OVER);
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
Assert.assertEquals(debugHitInfo.getLeft(), new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 46));

// Should go back to the caller function when stepping over again.
// Debugger should not hit the breakpoint inside function invocations when trying to step over the caller
// function.
debugTestRunner.resumeProgram(debugHitInfo.getRight(), DebugTestRunner.DebugResumeKind.STEP_OVER);
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
Assert.assertEquals(debugHitInfo.getLeft(), new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 31));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public void testStepRequestsOnRecursiveFunctions() throws BallerinaTestException
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
Assert.assertEquals(debugHitInfo.getLeft(), new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 26));

// tries STEP_OVER request on the recursive function call line, which should results in a debug hit on the
// user configured breakpoint (since STEP_OVER request should honor any breakpoints which get reached during
// the program execution, before reaching to the next line of the same method).
// tries STEP_OVER request on the recursive function call line, which should not results in a debug hit on the
// user configured breakpoint (since STEP requests should not depend on any breakpoints which get reached
// during the program execution, before reaching to the next line of the same method).
debugTestRunner.resumeProgram(debugHitInfo.getRight(), DebugTestRunner.DebugResumeKind.STEP_OVER);
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
Assert.assertEquals(debugHitInfo.getLeft(), debugTestRunner.testBreakpoints.get(0));
Assert.assertEquals(debugHitInfo.getLeft(), new BallerinaTestDebugPoint(debugTestRunner.testEntryFilePath, 26));

// Todo - enable after fixing https://github.com/ballerina-platform/ballerina-lang/issues/34847
// since now the breakpoint is removed, STEP_OVER request should result in a debug hit on next immediate
Expand Down

0 comments on commit 06e7fa7

Please sign in to comment.