aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_parse.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-24 06:17:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-24 06:17:55 +0000
commitb2abac2e8b475e0e19a398e79b7ff2b6170e1d3d (patch)
tree42d30e2e7babdd137c5f0176c09ac3c20422cbd8 /test/ruby/test_parse.rb
parent978b1f6ecca934687a9be242655c621241ea7d9c (diff)
downloadruby-b2abac2e8b475e0e19a398e79b7ff2b6170e1d3d.tar.gz
parse.y: args tail at error
* parse.y (new_args_tail_gen): abandon parsing arguments after error. reported by ilsani Martino Sani (ilsani) at https://hackerone.com/reports/221201 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r--test/ruby/test_parse.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index b4a63e369d..c2ee56ae52 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -958,6 +958,13 @@ x = __ENCODING__
assert_syntax_error(" 0b\n", /\^/)
end
+ def test_error_def_in_argument
+ assert_separately([], "#{<<-"begin;"}\n#{<<~"end;"}")
+ begin;
+ assert_syntax_error("def f r:def d; def f 0end", /unexpected/)
+ end;
+ end
+
=begin
def test_past_scope_variable
assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}