From 7a6542400dfce2ebb260da2c64cbb0e626b1243e Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 14 Jul 2012 09:18:51 +0000 Subject: array.c: fill with nil * array.c (rb_get_values_at): fill with nil out of range. [ruby-core:43678] [Bug #6203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index a4fda99474..92c624b57b 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1831,7 +1831,9 @@ class TestArray < Test::Unit::TestCase def test_values_at2 a = [0, 1, 2, 3, 4, 5] assert_equal([1, 2, 3], a.values_at(1..3)) - assert_equal([], a.values_at(7..8)) + assert_equal([nil, nil], a.values_at(7..8)) + bug6203 = '[ruby-core:43678]' + assert_equal([4, 5, nil, nil], a.values_at(4..7), bug6203) assert_equal([nil], a.values_at(2**31-1)) end -- cgit v1.2.3