diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-06-01 23:43:31 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-06-07 18:44:07 +0900 |
commit | c0ba35f3344652bca7768cf37f367ff40f5e973e (patch) | |
tree | 45f379f05871b14d844ce4818886d7e75787a73d /test/ruby | |
parent | 9d24ddbb53b296105177e1badce226c4e575dcc7 (diff) |
Differentiate `...` in lambda arguments
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_syntax.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index cf0a93e185..6245c73ec3 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1508,10 +1508,11 @@ eom assert_valid_syntax('def nil(...) end') assert_valid_syntax('def true(...) end') assert_valid_syntax('def false(...) end') + unexpected = /unexpected \.{3}/ assert_syntax_error('iter do |...| end', /unexpected/) assert_syntax_error('iter {|...|}', /unexpected/) - assert_syntax_error('->... {}', /unexpected/) - assert_syntax_error('->(...) {}', /unexpected/) + assert_syntax_error('->... {}', unexpected) + assert_syntax_error('->(...) {}', unexpected) assert_syntax_error('def foo(x, y, z) bar(...); end', /unexpected/) assert_syntax_error('def foo(x, y, z) super(...); end', /unexpected/) assert_syntax_error('def foo(...) yield(...); end', /unexpected/) |