Skip to content
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

Ruby 2.5: Add String#delete_prefix and String#delete_prefix! #4993

Merged
merged 2 commits into from Jan 25, 2018

Conversation

@ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented Jan 20, 2018

@ChrisBr
Copy link
Contributor Author

@ChrisBr ChrisBr commented Jan 20, 2018

Please note that the last test in test_delete_prefix! currently fails:

    s = S("ax")
    o = Struct.new(:s).new(s)
    def o.to_str
      s.freeze
      "a"
    end
    assert_raise_with_message(RuntimeError, /frozen/) {s.delete_prefix!(o)}

I'm wondering what I do wrong here as I do a frozen check in delete_prefix!
cc @enebo @headius

ChrisBr added 2 commits Jan 20, 2018
to remove leading substr.
https://bugs.ruby-lang.org/issues/12694
Support #4876
c&p from 10082360b9124c3eaabfccf4fe10a3640c40a05e.
#4876.
@ChrisBr ChrisBr force-pushed the ChrisBr:feature/string-prefix branch from 5958f36 to 3817407 Jan 25, 2018
@ChrisBr
Copy link
Contributor Author

@ChrisBr ChrisBr commented Jan 25, 2018

@enebo @headius fixed the failing test. The problem was that the modify_check() was called before the freeze call was executed. I moved the modifyCheck() now one line down which fixed it.

@enebo enebo added this to the JRuby 9.3.0.0 milestone Jan 25, 2018
@enebo enebo merged commit a9b3836 into jruby:ruby-2.5 Jan 25, 2018
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@enebo enebo modified the milestones: JRuby 9.3.0.0, JRuby 9.2.0.0 Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants