<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_range.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) da4464b824857d7610f9865ceb452ce0ead49164: [Backport #19426]</title>
<updated>2025-03-13T05:27:06+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-03-13T04:34:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=469a0a4a08dc4b3d3b6387b1f569108cc0750f17'/>
<id>469a0a4a08dc4b3d3b6387b1f569108cc0750f17</id>
<content type='text'>
	[Bug #19426] Fix endless `Range#step` with `#succ` method
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #19426] Fix endless `Range#step` with `#succ` method
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 25711683e86271385e8abe09a9c03782000e48db: [Backport #19864]</title>
<updated>2023-09-24T04:48:08+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-09-24T04:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=217ef2bf89b3861e83c2e2a3a633c019f0731de6'/>
<id>217ef2bf89b3861e83c2e2a3a633c019f0731de6</id>
<content type='text'>
	Fix regression when testing inclusion in unbounded ranges

	Caused by 04a92a6764bf678919cf4b68a27496a39d6b886a.  This treats
	unbounded ranges of arbitrary objects the same as how unbounded
	string ranges are treated:

	  (..x)  === y  # (y &lt;=&gt; x) &lt;= 0
	  (...x) === y  # (y &lt;=&gt; x) &lt;  0
	  (x..)  === y  # (x &lt;=&gt; y) &lt;= 0

	Fixes [Bug #19864]
	---
	 range.c                 |  9 +++++++++
	 test/ruby/test_range.rb | 23 +++++++++++++++++++++++
	 2 files changed, 32 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix regression when testing inclusion in unbounded ranges

	Caused by 04a92a6764bf678919cf4b68a27496a39d6b886a.  This treats
	unbounded ranges of arbitrary objects the same as how unbounded
	string ranges are treated:

	  (..x)  === y  # (y &lt;=&gt; x) &lt;= 0
	  (...x) === y  # (y &lt;=&gt; x) &lt;  0
	  (x..)  === y  # (x &lt;=&gt; y) &lt;= 0

	Fixes [Bug #19864]
	---
	 range.c                 |  9 +++++++++
	 test/ruby/test_range.rb | 23 +++++++++++++++++++++++
	 2 files changed, 32 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 1a149aab776aa6741628eb35482eff1ded197fd2,fb17c833f542222afdf482924877d43aa577782d,60f22ebf86248388b41b4ec751d16700f2b4b621: [Backport #19533]</title>
<updated>2023-07-17T07:07:39+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-07-17T07:07:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5328c58c7d00540f4f56749aaeefb68761bd7eba'/>
<id>5328c58c7d00540f4f56749aaeefb68761bd7eba</id>
<content type='text'>
	Extract range type check functions

	---
	 range.c | 55 ++++++++++++++++++++++++++++++++++++-------------------
	 1 file changed, 36 insertions(+), 19 deletions(-)

	[Bug #19533] Fix infinite range inclusion with numeric value

	---
	 range.c                 | 10 +++++++---
	 test/ruby/test_range.rb |  2 ++
	 2 files changed, 9 insertions(+), 3 deletions(-)

	[Bug #19533] Add spec of infinite range inclusion

	---
	 spec/ruby/core/range/case_compare_spec.rb | 6 ++++++
	 1 file changed, 6 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Extract range type check functions

	---
	 range.c | 55 ++++++++++++++++++++++++++++++++++++-------------------
	 1 file changed, 36 insertions(+), 19 deletions(-)

	[Bug #19533] Fix infinite range inclusion with numeric value

	---
	 range.c                 | 10 +++++++---
	 test/ruby/test_range.rb |  2 ++
	 2 files changed, 9 insertions(+), 3 deletions(-)

	[Bug #19533] Add spec of infinite range inclusion

	---
	 spec/ruby/core/range/case_compare_spec.rb | 6 ++++++
	 1 file changed, 6 insertions(+)
</pre>
</div>
</content>
</entry>
<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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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>
</feed>
