@@ -474,10 +474,21 @@ try
474
474
frame, bp = @interpret g_1 (2.0 )
475
475
stacktrace_lines = split (sprint (Base. display_error, bp. err, leaf (frame)), ' \n ' )
476
476
@test occursin (string (" ERROR: " , sprint (showerror, ErrorException (" foo" ))), stacktrace_lines[1 ])
477
- @test occursin (" [1] error(::String) at error.jl:" , stacktrace_lines[3 ])
478
- @test occursin (" [2] g_3(::Float64) at $(@__FILE__ ) :$(line_g - 1 ) " , stacktrace_lines[4 ])
479
- @test occursin (" [3] g_2(::Float64) at $(@__FILE__ ) :$(line_g - 2 ) " , stacktrace_lines[5 ])
480
- @test occursin (" [4] g_1(::Float64) at $(@__FILE__ ) :$(line_g - 3 ) " , stacktrace_lines[6 ])
477
+ if isdefined (Base, :print_stackframe )
478
+ @test occursin (" [1] error(s::String)" , stacktrace_lines[3 ])
479
+ @test occursin (" [2] g_3(x::Float64)" , stacktrace_lines[5 ])
480
+ thefile = Base. replaceuserpath (@__FILE__ )
481
+ @test occursin (" $thefile :$(line_g - 1 ) " , stacktrace_lines[6 ])
482
+ @test occursin (" [3] g_2(x::Float64)" , stacktrace_lines[7 ])
483
+ @test occursin (" $thefile :$(line_g - 2 ) " , stacktrace_lines[8 ])
484
+ @test occursin (" [4] g_1(x::Float64)" , stacktrace_lines[9 ])
485
+ @test occursin (" $thefile :$(line_g - 3 ) " , stacktrace_lines[10 ])
486
+ else
487
+ @test occursin (" [1] error(::String) at error.jl:" , stacktrace_lines[3 ])
488
+ @test occursin (" [2] g_3(::Float64) at $(@__FILE__ ) :$(line_g - 1 ) " , stacktrace_lines[4 ])
489
+ @test occursin (" [3] g_2(::Float64) at $(@__FILE__ ) :$(line_g - 2 ) " , stacktrace_lines[5 ])
490
+ @test occursin (" [4] g_1(::Float64) at $(@__FILE__ ) :$(line_g - 3 ) " , stacktrace_lines[6 ])
491
+ end
481
492
finally
482
493
break_off (:error )
483
494
end
@@ -492,11 +503,24 @@ try
492
503
frame, bp = JuliaInterpreter. debug_command (frame, :c , true )
493
504
stacktrace_lines = split (sprint (Base. display_error, bp. err, leaf (frame)), ' \n ' )
494
505
@test occursin (string (" ERROR: " , sprint (showerror, ErrorException (" foo" ))), stacktrace_lines[1 ])
495
- @test occursin (" [1] error(::String) at error.jl:" , stacktrace_lines[3 ])
496
- @test occursin (" [2] g_3(::Float64) at $(@__FILE__ ) :$(line_g - 1 ) " , stacktrace_lines[4 ])
497
- @test occursin (" [3] g_2(::Float64) at $(@__FILE__ ) :$(line_g - 2 ) " , stacktrace_lines[5 ])
498
- @test occursin (" [4] g_1(::Float64) at $(@__FILE__ ) :$(line_g - 3 ) " , stacktrace_lines[6 ])
499
- @test occursin (" [5] top-level scope at $(@__FILE__ ) :$(line2_g - 2 ) " , stacktrace_lines[7 ])
506
+ if isdefined (Base, :print_stackframe )
507
+ @test occursin (" [1] error(s::String)" , stacktrace_lines[3 ])
508
+ thefile = Base. replaceuserpath (@__FILE__ )
509
+ @test occursin (" [2] g_3(x::Float64)" , stacktrace_lines[5 ])
510
+ @test occursin (" $thefile :$(line_g - 1 ) " , stacktrace_lines[6 ])
511
+ @test occursin (" [3] g_2(x::Float64)" , stacktrace_lines[7 ])
512
+ @test occursin (" $thefile :$(line_g - 2 ) " , stacktrace_lines[8 ])
513
+ @test occursin (" [4] g_1(x::Float64)" , stacktrace_lines[9 ])
514
+ @test occursin (" $thefile :$(line_g - 3 ) " , stacktrace_lines[10 ])
515
+ @test occursin (" [5] top-level scope" , stacktrace_lines[11 ])
516
+ @test occursin (" $thefile :$(line2_g - 2 ) " , stacktrace_lines[12 ])
517
+ else
518
+ @test occursin (" [1] error(::String) at error.jl:" , stacktrace_lines[3 ])
519
+ @test occursin (" [2] g_3(::Float64) at $(@__FILE__ ) :$(line_g - 1 ) " , stacktrace_lines[4 ])
520
+ @test occursin (" [3] g_2(::Float64) at $(@__FILE__ ) :$(line_g - 2 ) " , stacktrace_lines[5 ])
521
+ @test occursin (" [4] g_1(::Float64) at $(@__FILE__ ) :$(line_g - 3 ) " , stacktrace_lines[6 ])
522
+ @test occursin (" [5] top-level scope at $(@__FILE__ ) :$(line2_g - 2 ) " , stacktrace_lines[7 ])
523
+ end
500
524
finally
501
525
break_off (:error )
502
526
end
0 commit comments