<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby.git/test/ruby/test_range.rb, branch ruby_3_2</title>
<subtitle>github.com: ruby/ruby.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/'/>
<entry>
<title>Raise TypeError for endless non-numeric range include?</title>
<updated>2022-11-24T23:18:44+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-08-19T20:19:03+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=04a92a6764bf678919cf4b68a27496a39d6b886a'/>
<id>04a92a6764bf678919cf4b68a27496a39d6b886a</id>
<content type='text'>
Beginless ranges previously raised TypeError for this case,
except for string ranges, which had unexpected behavior:

  ('a'..'z').include?('ww') # false
  (..'z').include?('ww') # previously true, now TypeError

Use of include? with endless ranges could previously result
in an infinite loop.

This splits off a range_string_cover_internal function from
range_include_internal.

Fixes [Bug #18580]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Beginless ranges previously raised TypeError for this case,
except for string ranges, which had unexpected behavior:

  ('a'..'z').include?('ww') # false
  (..'z').include?('ww') # previously true, now TypeError

Use of include? with endless ranges could previously result
in an infinite loop.

This splits off a range_string_cover_internal function from
range_include_internal.

Fixes [Bug #18580]
</pre>
</div>
</content>
</entry>
<entry>
<title>Range#size returns nil for (.."a") and (nil..)</title>
<updated>2022-10-21T07:35:46+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2022-10-21T04:39:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=e026368061c56bc925aff58910a4b02f18b78c70'/>
<id>e026368061c56bc925aff58910a4b02f18b78c70</id>
<content type='text'>
Fixes [Bug #18983]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #18983]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Range#cover? returning true for beginless ranges of different types</title>
<updated>2022-06-06T16:59:22+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-04-22T02:46:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=c5475f42694eff35465c3332e0182c0611ca5918'/>
<id>c5475f42694eff35465c3332e0182c0611ca5918</id>
<content type='text'>
Previously `(2..).cover?("2"..)` was false, but
`(..2).cover?(.."2")` was true.  This changes it so both are false,
treating beginless ranges the same as endless ranges in regards to
type checks.

This also adds documentation to #cover? to describe behavior with
beginless and endless ranges, testing each documentation example,
which is how this bug was found.

Fixes [Bug #18155]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously `(2..).cover?("2"..)` was false, but
`(..2).cover?(.."2")` was true.  This changes it so both are false,
treating beginless ranges the same as endless ranges in regards to
type checks.

This also adds documentation to #cover? to describe behavior with
beginless and endless ranges, testing each documentation example,
which is how this bug was found.

Fixes [Bug #18155]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Range#include? for beginless exclusive string ranges</title>
<updated>2022-02-10T03:47:28+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-02-09T17:58:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=fd710d7e9995679db80b7adf35bbda2cd4db90c6'/>
<id>fd710d7e9995679db80b7adf35bbda2cd4db90c6</id>
<content type='text'>
Previously, include? would return true for the end of the range,
when it should return false because the range is exclusive.

Research and Analysis by Victor Shepelev.

Fixes [Bug #18577]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, include? would return true for the end of the range,
when it should return false because the range is exclusive.

Research and Analysis by Victor Shepelev.

Fixes [Bug #18577]
</pre>
</div>
</content>
</entry>
<entry>
<title>numeric.c, range.c: prohibit zero step</title>
<updated>2020-10-23T06:26:51+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@users.noreply.github.com</email>
</author>
<published>2020-10-23T06:26:51+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=f754b422855131111092c0c147d744775cc4793f'/>
<id>f754b422855131111092c0c147d744775cc4793f</id>
<content type='text'>
* numeric.c: prohibit zero step in Numeric#step

* range.c: prohibit zero step in Range#step

* Fix ruby-spec

[Feature #15573]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* numeric.c: prohibit zero step in Numeric#step

* range.c: prohibit zero step in Range#step

* Fix ruby-spec

[Feature #15573]</pre>
</div>
</content>
</entry>
<entry>
<title>freeze all Range objects.</title>
<updated>2020-09-25T13:16:55+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-09-25T09:05:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=0096d2b895395df5ab8696d3b6d444dc1b7730b6'/>
<id>0096d2b895395df5ab8696d3b6d444dc1b7730b6</id>
<content type='text'>
Matz want to try to freeze all Range objects.
[Feature #15504]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Matz want to try to freeze all Range objects.
[Feature #15504]
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "Special case Range#max for integer beginning and Float::Infinity end" (tests)</title>
<updated>2020-09-02T01:02:12+00:00</updated>
<author>
<name>Marc-Andre Lafortune</name>
<email>github@marc-andre.ca</email>
</author>
<published>2020-09-02T00:26:45+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=94b54b038c1f4d6d2b54e10dd0305b1bc283449b'/>
<id>94b54b038c1f4d6d2b54e10dd0305b1bc283449b</id>
<content type='text'>
Reverted in e080a4cdee
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverted in e080a4cdee
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Fix Range#{max,minmax} for range with integer beginning and non-integer end"</title>
<updated>2020-09-01T17:52:47+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2020-09-01T16:19:03+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=4db4faef0f96bfd3504f5eac454a0308c618ccd6'/>
<id>4db4faef0f96bfd3504f5eac454a0308c618ccd6</id>
<content type='text'>
This reverts commit 8900a25581822759daca528d46a75e0b743fc22e.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 8900a25581822759daca528d46a75e0b743fc22e.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Special case Range#max for integer beginning and Float::Infinity end"</title>
<updated>2020-09-01T17:52:47+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2020-09-01T16:18:44+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=e080a4cdeeb55dddb6247ffd2563d2dc8b84c919'/>
<id>e080a4cdeeb55dddb6247ffd2563d2dc8b84c919</id>
<content type='text'>
This reverts commit 05bf811c2839628aaef3d565daedb28be80d47ef.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 05bf811c2839628aaef3d565daedb28be80d47ef.
</pre>
</div>
</content>
</entry>
<entry>
<title>Special case Range#max for integer beginning and Float::Infinity end</title>
<updated>2020-07-19T14:25:55+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2020-07-16T17:11:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/ruby.git/commit/?id=05bf811c2839628aaef3d565daedb28be80d47ef'/>
<id>05bf811c2839628aaef3d565daedb28be80d47ef</id>
<content type='text'>
Popular Ruby libraries such as Rails and Rubocop relying on the
previous behavior, even though it is technically a bug. The
correct behavior is probably raising RangeError, since that is what
an endless range raises.

Related to [Bug #17017]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Popular Ruby libraries such as Rails and Rubocop relying on the
previous behavior, even though it is technically a bug. The
correct behavior is probably raising RangeError, since that is what
an endless range raises.

Related to [Bug #17017]
</pre>
</div>
</content>
</entry>
</feed>
