<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_array.rb, branch v3_0_4</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) cd4f5b13228879d954fa97b6aa479c4a5ef4fb0a,8db269edb3550a85dfab9b193ea115ca36912ced,ab63f6d8543903f177c46634f38e5428655f003b: [Backport #18140]</title>
<updated>2021-09-05T03:19:53+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-09-05T03:19:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=92846db6861eed324288819157e6c7722fc62fc2'/>
<id>92846db6861eed324288819157e6c7722fc62fc2</id>
<content type='text'>
	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	[ruby-core:105099] [Bug #18140]
	---
	 array.c                 | 1 +
	 test/ruby/test_array.rb | 6 ++++++
	 2 files changed, 7 insertions(+)

	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	Thanks @jhaberman for the test case

	[ruby-core:105099] [Bug #18140]
	---
	 ext/-test-/array/concat/depend          | 321 ++++++++++++++++++++++++++++++++
	 ext/-test-/array/concat/extconf.rb      |   2 +
	 ext/-test-/array/concat/to_ary_conact.c |  64 +++++++
	 test/-ext-/array/test_to_ary_concat.rb  |  20 ++
	 4 files changed, 407 insertions(+)
	 create mode 100644 ext/-test-/array/concat/depend
	 create mode 100644 ext/-test-/array/concat/extconf.rb
	 create mode 100644 ext/-test-/array/concat/to_ary_conact.c
	 create mode 100644 test/-ext-/array/test_to_ary_concat.rb

	Refined test [Bug #18140]

	---
	 ext/-test-/array/concat/to_ary_conact.c | 48 +++++++--------------------------
	 test/ruby/test_array.rb                 |  5 +++-
	 2 files changed, 13 insertions(+), 40 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	[ruby-core:105099] [Bug #18140]
	---
	 array.c                 | 1 +
	 test/ruby/test_array.rb | 6 ++++++
	 2 files changed, 7 insertions(+)

	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	Thanks @jhaberman for the test case

	[ruby-core:105099] [Bug #18140]
	---
	 ext/-test-/array/concat/depend          | 321 ++++++++++++++++++++++++++++++++
	 ext/-test-/array/concat/extconf.rb      |   2 +
	 ext/-test-/array/concat/to_ary_conact.c |  64 +++++++
	 test/-ext-/array/test_to_ary_concat.rb  |  20 ++
	 4 files changed, 407 insertions(+)
	 create mode 100644 ext/-test-/array/concat/depend
	 create mode 100644 ext/-test-/array/concat/extconf.rb
	 create mode 100644 ext/-test-/array/concat/to_ary_conact.c
	 create mode 100644 test/-ext-/array/test_to_ary_concat.rb

	Refined test [Bug #18140]

	---
	 ext/-test-/array/concat/to_ary_conact.c | 48 +++++++--------------------------
	 test/ruby/test_array.rb                 |  5 +++-
	 2 files changed, 13 insertions(+), 40 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) d43279edacd09edf3a43e02d62f5be475e7c3bcb,5dc36ddcd00fc556c04c15ce9770c5a84d7d43dc,523bf31564f160f899f8cf9f73540d6a6f687f17: [Backport #18138]</title>
<updated>2021-08-29T10:09:35+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-08-29T10:09:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8899fa0b3d41fd27dd1a2c6f75106cb78ff27236'/>
<id>8899fa0b3d41fd27dd1a2c6f75106cb78ff27236</id>
<content type='text'>
	Fix length calculation for Array#slice!

	Commit 4f24255 introduced a bug which allows a length to be passed to
	rb_ary_new4 which is too large, resulting in invalid memory access.

	For example:

	    (1..1000).to_a.slice!(-2, 1000)
	---
	 array.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Add out of range tests for Array#slice!

	---
	 test/ruby/test_array.rb | 13 +++++++++++++
	 1 file changed, 13 insertions(+)

	Add negative position tests [Bug #18138]

	---
	 test/ruby/test_array.rb | 4 ++++
	 1 file changed, 4 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix length calculation for Array#slice!

	Commit 4f24255 introduced a bug which allows a length to be passed to
	rb_ary_new4 which is too large, resulting in invalid memory access.

	For example:

	    (1..1000).to_a.slice!(-2, 1000)
	---
	 array.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Add out of range tests for Array#slice!

	---
	 test/ruby/test_array.rb | 13 +++++++++++++
	 1 file changed, 13 insertions(+)

	Add negative position tests [Bug #18138]

	---
	 test/ruby/test_array.rb | 4 ++++
	 1 file changed, 4 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) e019dd24df4ed7063ad80d4c2e4070141793f598,7954bb056be30e86c419fe3792064d28990a4999,7d3fdfb27dac456827b004d9e66a44b15f8cd762: [Backport #17736]</title>
<updated>2021-05-23T06:51:10+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-05-23T06:51:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=44b87adc07621b6a8eddfcf4aaff34ce634179d4'/>
<id>44b87adc07621b6a8eddfcf4aaff34ce634179d4</id>
<content type='text'>
	Ensure the receiver is modifiable before shrinking [Bug #17736]

	* Ensure the receiver is modifiable before shinking [Bug #17736]

	* Assert the receivers are not modified
	---
	 array.c                 |  1 +
	 test/ruby/test_array.rb | 36 ++++++++++++++++++++++++++++++++++++
	 2 files changed, 37 insertions(+)

	Some Hash destructive methods ensure the receiver modifiable [Bug
	 #17736]

	refs:

	* https://bugs.ruby-lang.org/issues/17736
	* https://github.com/ruby/ruby/pull/4296

	This commit aims to cover following methods

	* Hash#select!
	* Hash#filter!
	* Hash#keep_if
	* Hash#reject!
	* Hash#delete_if

	I think these are not all.

	---

	* Ensure the receiver is modifiable or not
	* Assert the receiver is not modified
	---
	 hash.c                 |  2 ++
	 test/ruby/test_hash.rb | 42 ++++++++++++++++++++++++++++++++++++++++++
	 2 files changed, 44 insertions(+)

	Hash#transform_values! ensures receiver modifiable in block [Bug
	 #17736]

	---
	 hash.c                 | 1 +
	 test/ruby/test_hash.rb | 9 +++++++++
	 2 files changed, 10 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Ensure the receiver is modifiable before shrinking [Bug #17736]

	* Ensure the receiver is modifiable before shinking [Bug #17736]

	* Assert the receivers are not modified
	---
	 array.c                 |  1 +
	 test/ruby/test_array.rb | 36 ++++++++++++++++++++++++++++++++++++
	 2 files changed, 37 insertions(+)

	Some Hash destructive methods ensure the receiver modifiable [Bug
	 #17736]

	refs:

	* https://bugs.ruby-lang.org/issues/17736
	* https://github.com/ruby/ruby/pull/4296

	This commit aims to cover following methods

	* Hash#select!
	* Hash#filter!
	* Hash#keep_if
	* Hash#reject!
	* Hash#delete_if

	I think these are not all.

	---

	* Ensure the receiver is modifiable or not
	* Assert the receiver is not modified
	---
	 hash.c                 |  2 ++
	 test/ruby/test_hash.rb | 42 ++++++++++++++++++++++++++++++++++++++++++
	 2 files changed, 44 insertions(+)

	Hash#transform_values! ensures receiver modifiable in block [Bug
	 #17736]

	---
	 hash.c                 | 1 +
	 test/ruby/test_hash.rb | 9 +++++++++
	 2 files changed, 10 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>Use category: :deprecated in warnings that are related to deprecation</title>
<updated>2020-12-18T17:54:11+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2020-09-28T17:10:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=05313c914b29f7027b27a91021ae2662f0149e54'/>
<id>05313c914b29f7027b27a91021ae2662f0149e54</id>
<content type='text'>
Also document that both :deprecated and :experimental are supported
:category option values.

The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.

Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).

Add assert_deprecated_warn to test assertions.  Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also document that both :deprecated and :experimental are supported
:category option values.

The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.

Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).

Add assert_deprecated_warn to test assertions.  Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
</pre>
</div>
</content>
</entry>
<entry>
<title>test/ruby: Check warning messages at a finer granularity</title>
<updated>2020-12-17T11:06:18+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-12-17T11:06:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9908177857a28633d6279c43a1ad4dfedcb98596'/>
<id>9908177857a28633d6279c43a1ad4dfedcb98596</id>
<content type='text'>
Instead of suppressing all warnings wholly in each test scripts by
setting `$VERBOSE` to `nil` in `setup` methods.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of suppressing all warnings wholly in each test scripts by
setting `$VERBOSE` to `nil` in `setup` methods.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make Array methods return Array instances instead of subclass instances</title>
<updated>2020-11-03T22:01:38+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2020-11-03T22:01:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2a294d499bf03211d02695f613f784a05943ea35'/>
<id>2a294d499bf03211d02695f613f784a05943ea35</id>
<content type='text'>
This changes the following methods to return Array instances instead
of subclass instances:

* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice/#[]
* Array#take
* Array#take_while
* Array#uniq
* Array#*

Fixes [Bug #6087]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changes the following methods to return Array instances instead
of subclass instances:

* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice/#[]
* Array#take
* Array#take_while
* Array#uniq
* Array#*

Fixes [Bug #6087]</pre>
</div>
</content>
</entry>
<entry>
<title>Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241)</title>
<updated>2020-10-20T17:40:18+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@users.noreply.github.com</email>
</author>
<published>2020-10-20T17:40:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a6a8576e877b02b83cabd0e712ecd377e7bc156b'/>
<id>a6a8576e877b02b83cabd0e712ecd377e7bc156b</id>
<content type='text'>
* Support ArithmeticSequence in Array#slice

* Extract rb_range_component_beg_len

* Use rb_range_values to check Range object

* Fix ary_make_partial_step

* Fix for negative step cases

* range.c: Describe the role of err argument in rb_range_component_beg_len

* Raise a RangeError when an arithmetic sequence refers the outside of an array

[Feature #16812]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Support ArithmeticSequence in Array#slice

* Extract rb_range_component_beg_len

* Use rb_range_values to check Range object

* Fix ary_make_partial_step

* Fix for negative step cases

* range.c: Describe the role of err argument in rb_range_component_beg_len

* Raise a RangeError when an arithmetic sequence refers the outside of an array

[Feature #16812]</pre>
</div>
</content>
</entry>
<entry>
<title>range.c: Fix an exception message in rb_range_beg_len</title>
<updated>2020-10-20T07:01:57+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@mrkn.jp</email>
</author>
<published>2020-10-20T07:00:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=18cecda46e427362fa3447679e5d8a917b5d6cb6'/>
<id>18cecda46e427362fa3447679e5d8a917b5d6cb6</id>
<content type='text'>
[Bug #17271]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #17271]
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure that the comparison succeeded [Bug #17205]</title>
<updated>2020-10-02T02:02:45+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-10-02T01:57:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89ca842dcce7f05942e2d7be3edc404c9556cafd'/>
<id>89ca842dcce7f05942e2d7be3edc404c9556cafd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>
</feed>
