mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_array.rb (test_aset): access with too big index
raises not ArgumentError but IndexError now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cac79cc388
commit
4b60da90f9
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jun 30 22:49:32 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* test/ruby/test_array.rb (test_aset): access with too big index
|
||||
raises not ArgumentError but IndexError now.
|
||||
|
||||
Mon Jun 30 22:30:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/test/unit/collector/dir.rb (recursive_collect): r15662 reverted.
|
||||
|
|
|
@ -1346,8 +1346,8 @@ class TestArray < Test::Unit::TestCase
|
|||
|
||||
def test_aset
|
||||
assert_raise(IndexError) { [0][-2] = 1 }
|
||||
assert_raise(ArgumentError) { [0][LONGP] = 2 }
|
||||
assert_raise(ArgumentError) { [0][(LONGP + 1) / 2 - 1] = 2 }
|
||||
assert_raise(IndexError) { [0][LONGP] = 2 }
|
||||
assert_raise(IndexError) { [0][(LONGP + 1) / 2 - 1] = 2 }
|
||||
a = [0]
|
||||
a[2] = 4
|
||||
assert_equal([0, nil, 4], a)
|
||||
|
|
Loading…
Reference in a new issue