summaryrefslogtreecommitdiff
path: root/test/ruby/test_call.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-12 02:19:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-12 02:19:13 +0000
commitc28b5723f6615fa429fc5b2606eb1b5b43bdb197 (patch)
tree9b73c93fbcc68f9b430e0ffe5c8951b2b50697b7 /test/ruby/test_call.rb
parentab9e4d11a35818b0001f749476f83beee3138da8 (diff)
vm_insnhelper.c: disable fastpath if splat
* vm_insnhelper.c (vm_callee_setup_arg): disable fastpath if splat argument, since argc may differ for each calls. [ruby-core:61422] [Bug #9622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_call.rb')
-rw-r--r--test/ruby/test_call.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb
index 8f861d96a1..5b81eb187a 100644
--- a/test/ruby/test_call.rb
+++ b/test/ruby/test_call.rb
@@ -16,4 +16,19 @@ class TestCall < Test::Unit::TestCase
assert_equal([1, 2, 3, 4], aaa(1, 2, 3, 4))
assert_equal([1, 2, 3, 4], aaa(1, *[2, 3, 4]))
end
+
+ def test_callinfo
+ bug9622 = '[ruby-core:61422] [Bug #9622]'
+ o = Class.new do
+ def foo(*args)
+ bar(:foo, *args)
+ end
+ def bar(name)
+ name
+ end
+ end.new
+ e = assert_raise(ArgumentError) {o.foo(100)}
+ assert_nothing_raised(ArgumentError) {o.foo}
+ assert_raise_with_message(ArgumentError, e.message, bug9622) {o.foo(100)}
+ end
end