Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/irb/debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setup(irb)
def DEBUGGER__.capture_frames(*args)
frames = capture_frames_without_irb(*args)
frames.reject! do |frame|
frame.realpath&.start_with?(IRB_DIR) || frame.path == "<internal:prelude>"
frame.realpath&.start_with?(IRB_DIR) || frame.path.start_with?("<internal:")
end
frames
end
Expand Down
28 changes: 22 additions & 6 deletions test/irb/test_irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,14 @@ def bar
assert_match(/irbtest-.*\.rb:2:in (`|'Object#)foo': error \(RuntimeError\)/, output)
frame_traces = output.split("\n").map(&:strip).grep(/from /)

expected_traces = if RUBY_VERSION >= "3.3.0"
expected_traces = if RUBY_VERSION >= "3.5.0"
[
/from .*\/irbtest-.*.rb:6:in (`|'Object#)bar'/,
/from .*\/irbtest-.*.rb\(irb\):1:in [`']<main>'/,
/from .*\/irbtest-.*.rb:9:in (`|'Binding#)irb'/,
/from .*\/irbtest-.*.rb:9:in [`']<main>'/
]
elsif RUBY_VERSION >= "3.3.0"
[
/from .*\/irbtest-.*.rb:6:in (`|'Object#)bar'/,
/from .*\/irbtest-.*.rb\(irb\):1:in [`']<main>'/,
Expand Down Expand Up @@ -934,11 +941,20 @@ def bar
assert_match(/irbtest-.*\.rb:2:in (`|'Object#)foo': error \(RuntimeError\)/, output)
frame_traces = output.split("\n").map(&:strip).grep(/from /)

expected_traces = [
/from .*\/irbtest-.*.rb:6:in (`|'Object#)bar'/,
/from .*\/irbtest-.*.rb\(irb\):1:in [`']<main>'/,
/from .*\/irbtest-.*.rb:9:in [`']<main>'/
]
expected_traces = if RUBY_VERSION >= "3.5.0"
[
/from .*\/irbtest-.*.rb:6:in (`|'Object#)bar'/,
/from .*\/irbtest-.*.rb\(irb\):1:in [`']<main>'/,
/from .*\/irbtest-.*.rb:9:in (`|'Binding#)irb'/,
/from .*\/irbtest-.*.rb:9:in [`']<main>'/
]
else
[
/from .*\/irbtest-.*.rb:6:in (`|'Object#)bar'/,
/from .*\/irbtest-.*.rb\(irb\):1:in [`']<main>'/,
/from .*\/irbtest-.*.rb:9:in [`']<main>'/
]
end

expected_traces.reverse! if RUBY_VERSION < "3.0.0"

Expand Down