summaryrefslogtreecommitdiff
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-12 17:23:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-12 17:23:46 +0000
commit34761b7f965ec7f2cab4179caa672b32a450dc79 (patch)
tree652b1e7dc1563291f5a0e8d2bf1759180769f596 /test/ruby/test_array.rb
parente95cac18bd9648aa023e390a716c5887155b72b7 (diff)
array.c: fix position in message
* array.c (rb_ary_insert): fix the position in error message, when it is less than -1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 60938937cd..d1a570099f 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -2124,6 +2124,7 @@ class TestArray < Test::Unit::TestCase
assert_raise(TypeError) { a.insert(Object.new) }
assert_equal([0, 1, 2], a.insert(-1, 2))
assert_equal([0, 1, 3, 2], a.insert(-2, 3))
+ assert_raise_with_message(IndexError, /-6/) { a.insert(-6, 4) }
assert_raise(RuntimeError) { [0].freeze.insert(0)}
assert_raise(ArgumentError) { [0].freeze.insert }
end