Support Ruby 3.4's new error message format#237
Merged
kou merged 3 commits intotest-unit:masterfrom Feb 15, 2024
Merged
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
kou
reviewed
Feb 15, 2024
test/test-test-case.rb
Outdated
| end | ||
|
|
||
| def normalize_location(location) | ||
| def normalize_backtrace(location) |
Member
There was a problem hiding this comment.
Could you keep normalize_location name?
The argument is a backtrace but we call it as (a fault's) "location" here.
test/test-test-case.rb
Outdated
| end | ||
| filtered_location.collect do |entry| | ||
| entry.sub(/:\d+:/, ":0:") | ||
| entry.sub(/:\d+:/, ":0:").sub(/in [`'](?:[^']+?[#.])?/, "in '") |
Member
There was a problem hiding this comment.
Can we simplify this?
Suggested change
| entry.sub(/:\d+:/, ":0:").sub(/in [`'](?:[^']+?[#.])?/, "in '") | |
| entry.sub(/:\d+: in [`']/, ":0:in '") |
Contributor
Author
There was a problem hiding this comment.
I did this one too. Still, (?:[^']+?[#.])? is needed to remove the receiver from the backtrace.
Member
|
Thanks! |
hsbt
added a commit
to hsbt/ruby
that referenced
this pull request
Feb 19, 2024
hsbt
added a commit
to ruby/ruby
that referenced
this pull request
Feb 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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