#3203. Add VM - CFE interaction tests for declaring constructors #3356
+167
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some clarification about what we are checking in this PR.
The tests consist form 5 tests defined in
testsarray. Below in the description each of these tests.The firsts one is
hasStoppedAtBreakpointis simple copy-paste from https://github.com/dart-lang/sdk/blob/main/pkg/vm_service/test/dot_shorthands_test.dartTest the interaction between expression evaluation and declaring constructor invocation. This test simply checks that an expression involving a declaring constructor invocation is evaluated and that the result contains the correct values.
Test the interaction of breakpoints with declaring constructors. This test checks that execution stops at a breakpoint on the expression that contains a declaring constructor invocation. A breakpoint is added to LINE_X in the test code, and then we check the line and column of the breakpoint position.
runStepIntoThroughProgramRecordingStops. The most interesting test here is the one that requires explanation.This test emulates stopping at a breakpoint and then performing a "step into" operation, recording each step.
Here, we depend on the previous test (#3). In that test, we added and then removed several breakpoints, but the one on
LINE_Ewas not removed. As a result, the service contains a single breakpoint onLINE_E, and we are debuggingtesteeMainwhile performing "step into" actions.It’s hard to predict exactly where on
class C1(var int v1, final int v2);the debugger will stop, but I suppose that this code is analogous toHere debugger stops at:
And therefore in case of the declaring constructor I expect the same stops.
checkRecordedStops(stops, expected),. Check the stops written in the previous test.Please review.