-
Notifications
You must be signed in to change notification settings - Fork 186
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
Make rpartition compatible with Ruby 2.7 #2320
Conversation
@@ -205,7 +205,7 @@ def rpartition(pattern) | |||
if pattern.kind_of? Regexp | |||
if m = Truffle::RegexpOperations.search_region(pattern, self, 0, size, false) | |||
Primitive.regexp_last_match_set(Primitive.caller_special_variables, m) | |||
[m.pre_match, m[0], m.post_match] | |||
return [m.pre_match, m[0], m.post_match] |
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.
Hmmm was this always effectively a typo then? A missing return
?
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 be, yes
Don't worry about the |
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.
Thanks for the fix and specs!
end | ||
|
||
it "returns new object if doesn't match" do | ||
"hello".rpartition("/no_match/").last.object_id.should_not eql("hello".object_id) |
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.
.last.should_not.equal?("hello")
is better here, I'll change to that.
Also we need to store the first "hello"
in a variable because this file does not use frozen string literals.
@eregon is anything else I can do here? |
When it gains the |
In this case it was a transient failure in the internal CI (webrick being not thread-safe), I've restarted it. |
PullRequest: truffleruby/2557
Mainly it's needed to fix failing tests of the mechanize gem.
Fixes #2321