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

Fix bug in Range comparisons when comparing to excluded-end Range #35776

Merged

Conversation

Projects
None yet
2 participants
@owst
Copy link
Contributor

owst commented Mar 28, 2019

Summary

I noticed that the addition of support for Range arguments to #cover? and friends in #32938 didn't correctly handle exclude-end arguments:

Before:

(1..10).cover?(1...11) => false

After:

(1..10).cover?(1...11) => true

Other Information

See https://git.io/fjTtz for the commit against Ruby core that added
support for Range arguments, with similar handling of this case.

Fix bug in Range comparisons when comparing to excluded-end Range
Before:
```ruby
(1..10).cover?(1...11) => false
```

After:
```ruby
(1..10).cover?(1...11) => true
```

See https://git.io/fjTtz for the commit against Ruby core that added
support for Range arguments, with similar handling of this case.

@rails-bot rails-bot bot added the activesupport label Mar 28, 2019

@rafaelfranca rafaelfranca merged commit a7723b8 into rails:master Mar 28, 2019

3 checks passed

buildkite/rails Build #59918 passed (17 minutes, 45 seconds)
Details
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.