@@ -412,17 +412,20 @@ public void testSourceFileURI() throws Throwable {
412
412
Path importingFile = tempDir .resolve ("importing.py" );
413
413
Files .write (importedFile , ("def sum(a, b):\n " +
414
414
" return a + b\n " ).getBytes ());
415
- Files .write (importingFile , ("import imported\n " +
415
+ Files .write (importingFile , ("import sys\n " +
416
+ "sys.path.insert(0, '" + tempDir .toString () + "')\n " +
417
+ "import imported\n " +
416
418
"imported.sum(2, 3)\n " ).getBytes ());
417
419
Source source = Source .newBuilder ("python" , importingFile .toFile ()).build ();
418
420
try (DebuggerSession session = tester .startSession ()) {
419
- session .suspendNextExecution ();
421
+ Breakpoint breakpoint = Breakpoint .newBuilder (importingFile .toUri ()).lineIs (4 ).build ();
422
+ session .install (breakpoint );
420
423
tester .startEval (source );
421
424
expectSuspended ((SuspendedEvent event ) -> {
422
425
assertEquals (importingFile .toUri (), event .getSourceSection ().getSource ().getURI ());
423
426
DebugStackFrame frame = event .getTopStackFrame ();
424
- assertEquals (1 , frame .getSourceSection ().getStartLine ());
425
- event .prepareStepInto (2 );
427
+ assertEquals (4 , frame .getSourceSection ().getStartLine ());
428
+ event .prepareStepInto (1 );
426
429
});
427
430
expectSuspended ((SuspendedEvent event ) -> {
428
431
assertEquals (importedFile .toUri (), event .getSourceSection ().getSource ().getURI ());
0 commit comments