diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-09 11:04:05 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-09 11:04:05 +0000 |
commit | efeee7afa9c9dc442a4eb591cc0f6a89dc03bc01 (patch) | |
tree | b3b1c429b8e4fab6a256b7e005391d9b832a13dd /test | |
parent | 5bde05f98f97557e0d040d7a579111e5bb0f2c0e (diff) |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_array.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |