-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Ruby 3.4's new error message format #237
Conversation
Ruby 3.4 will use a single quote instead of a backtrick as an open quote. https://bugs.ruby-lang.org/issues/16495 Also, the backtrace line will have not only a method name but also its receiver class. https://bugs.ruby-lang.org/issues/19117
test/test-test-case.rb
Outdated
@@ -65,14 +65,14 @@ def internal_backtrace_entry?(entry) | |||
entry.start_with?("<internal:") | |||
end | |||
|
|||
def normalize_location(location) | |||
def normalize_backtrace(location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you keep normalize_location
name?
The argument is a backtrace but we call it as (a fault's) "location" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
test/test-test-case.rb
Outdated
filtered_location = location.reject do |entry| | ||
jruby_backtrace_entry?(entry) or | ||
rubinius_backtrace_entry?(entry) or | ||
internal_backtrace_entry?(entry) | ||
end | ||
filtered_location.collect do |entry| | ||
entry.sub(/:\d+:/, ":0:") | ||
entry.sub(/:\d+:/, ":0:").sub(/in [`'](?:[^']+?[#.])?/, "in '") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this?
entry.sub(/:\d+:/, ":0:").sub(/in [`'](?:[^']+?[#.])?/, "in '") | |
entry.sub(/:\d+: in [`']/, ":0:in '") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this one too. Still, (?:[^']+?[#.])?
is needed to remove the receiver from the backtrace.
Thanks! |
Ruby 3.4 will use a single quote instead of a backtrick as an open quote.
https://bugs.ruby-lang.org/issues/16495
Also, the backtrace line will have not only a method name but also its receiver class.
https://bugs.ruby-lang.org/issues/19117