@@ -1144,11 +1144,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
1144
1144
await new Promise ( ( resolve ) => setTimeout ( resolve , 2_000 ) ) ;
1145
1145
} ) ;
1146
1146
1147
- test ( 'should set breakpoints during continue (legacy)' , async function ( ) {
1148
- if ( isDlvDap ) {
1149
- this . skip ( ) ; // not working in dlv-dap.
1150
- }
1151
-
1147
+ test ( 'should set breakpoints during continue' , async ( ) => {
1152
1148
const PROGRAM = path . join ( DATA_ROOT , 'sleep' ) ;
1153
1149
1154
1150
const FILE = path . join ( DATA_ROOT , 'sleep' , 'sleep.go' ) ;
@@ -1175,7 +1171,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
1175
1171
] ) ;
1176
1172
} ) ;
1177
1173
1178
- async function setBreakpointsWhileRunning ( resumeFunc : ( ) => void ) {
1174
+ async function setBreakpointsWhileRunningStep ( resumeFunc : ( ) => Promise < void > ) {
1179
1175
const PROGRAM = path . join ( DATA_ROOT , 'sleep' ) ;
1180
1176
1181
1177
const FILE = path . join ( DATA_ROOT , 'sleep' , 'sleep.go' ) ;
@@ -1197,18 +1193,16 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
1197
1193
1198
1194
// The program is now stopped at the line containing time.Sleep().
1199
1195
// Issue a next request, followed by a setBreakpointsRequest.
1200
- resumeFunc ( ) ;
1196
+ await resumeFunc ( ) ;
1201
1197
1202
- // Note: the current behavior of setting a breakpoint during a next
1203
- // request will cause the step to be interrupted, so it may not be
1204
- // stopped on the next line.
1198
+ // Assert that the program completes the step request.
1205
1199
await Promise . all ( [
1206
1200
dc . setBreakpointsRequest ( {
1207
1201
lines : [ resumeBreakpoint . line ] ,
1208
1202
breakpoints : [ { line : resumeBreakpoint . line , column : 0 } ] ,
1209
1203
source : { path : resumeBreakpoint . path }
1210
1204
} ) ,
1211
- dc . assertStoppedLocation ( 'pause ' , { } )
1205
+ dc . assertStoppedLocation ( 'step ' , { } )
1212
1206
] ) ;
1213
1207
1214
1208
// Once the 'step' has completed, continue the program and
@@ -1220,21 +1214,11 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
1220
1214
] ) ;
1221
1215
}
1222
1216
1223
- test ( 'should set breakpoints during continue' , async function ( ) {
1224
- if ( ! isDlvDap ) {
1225
- this . skip ( ) ;
1226
- }
1227
- await setBreakpointsWhileRunning ( async ( ) => {
1228
- const nextResponse = await dc . continueRequest ( { threadId : 1 } ) ;
1229
- assert . ok ( nextResponse . success ) ;
1230
- } ) ;
1231
- } ) ;
1232
-
1233
1217
test ( 'should set breakpoints during next' , async function ( ) {
1234
1218
if ( ! isDlvDap ) {
1235
1219
this . skip ( ) ;
1236
1220
}
1237
- await setBreakpointsWhileRunning ( async ( ) => {
1221
+ await setBreakpointsWhileRunningStep ( async ( ) => {
1238
1222
const nextResponse = await dc . nextRequest ( { threadId : 1 } ) ;
1239
1223
assert . ok ( nextResponse . success ) ;
1240
1224
} ) ;
@@ -1245,7 +1229,9 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
1245
1229
this . skip ( ) ;
1246
1230
}
1247
1231
1248
- await setBreakpointsWhileRunning ( async ( ) => {
1232
+ await setBreakpointsWhileRunningStep ( async ( ) => {
1233
+ await Promise . all ( [ dc . stepInRequest ( { threadId : 1 } ) , dc . assertStoppedLocation ( 'step' , { } ) ] ) ;
1234
+
1249
1235
const stepOutResponse = await dc . stepOutRequest ( { threadId : 1 } ) ;
1250
1236
assert . ok ( stepOutResponse . success ) ;
1251
1237
} ) ;
0 commit comments