diff options
author | yui-knk <spiketeika@gmail.com> | 2022-11-18 19:42:37 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2022-11-19 10:17:16 +0900 |
commit | 082cfcfd06f85ea5c578f0654431dad5c2f32814 (patch) | |
tree | 19015cab6ad3e8618fe88bc40e9b7e3571f466b6 /test/ruby | |
parent | 5c505f4a48cafd83493ce2744373bd33361ab9f1 (diff) | |
download | ruby-082cfcfd06f85ea5c578f0654431dad5c2f32814.tar.gz |
Add test cases for args forwarding after rest argument
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_syntax.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 7a5f4c9528..251448ec01 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1709,6 +1709,8 @@ eom assert_syntax_error('def foo(...) foo[...] = x; end', /unexpected/) assert_syntax_error('def foo(...) foo(...) { }; end', /both block arg and actual block given/) assert_syntax_error('def foo(...) defined?(...); end', /unexpected/) + assert_syntax_error('def foo(*rest, ...) end', '... after rest argument') + assert_syntax_error('def foo(*, ...) end', '... after rest argument') obj1 = Object.new def obj1.bar(*args, **kws, &block) |