aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-14 09:18:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-14 09:18:51 +0000
commit7a6542400dfce2ebb260da2c64cbb0e626b1243e (patch)
tree9dd6e0bf740e6081fa18dcf8d5646ed0ad7c685e /test
parentb0d53d51f5ce538095ffebaa0e8fd0552b5ebd75 (diff)
downloadruby-7a6542400dfce2ebb260da2c64cbb0e626b1243e.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_array.rb4
1 files changed, 3 insertions, 1 deletions
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