From efeee7afa9c9dc442a4eb591cc0f6a89dc03bc01 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 9 Nov 2012 11:04:05 +0000 Subject: * array.c (rb_ary_splice): fix r37583 doesn't condier the case when beg > array length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index b0e7058b5b..8d264d9230 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -426,6 +426,18 @@ class TestArray < Test::Unit::TestCase a = @cls[1, 2, 3] a[-1, 0] = a assert_equal([1, 2, 1, 2, 3, 3], a) + + a = @cls[] + a[5,0] = [5] + assert_equal([nil, nil, nil, nil, nil, 5], a) + + a = @cls[1] + a[1,0] = [2] + assert_equal([1, 2], a) + + a = @cls[1] + a[1,1] = [2] + assert_equal([1, 2], a) end def test_assoc -- cgit v1.2.3