diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-06 00:01:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-06 00:01:29 +0000 |
commit | 60511a5b3bee9a06bbcbbe331e4371ee15f702c4 (patch) | |
tree | ec92ef61307c6e3ed12bd1ce8c6f47647843c8be /test/ruby/test_syntax.rb | |
parent | 1c35f251167f90299cc2e981b622ea76c735419f (diff) | |
download | ruby-60511a5b3bee9a06bbcbbe331e4371ee15f702c4.tar.gz |
parse.y: fix segv after invalid keyword argument
* parse.y (kwd_append): fix segv after invalid keyword argument,
preceding keyword list is NULL when syntax error is there.
[ruby-core:71356] [Bug #11663]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r-- | test/ruby/test_syntax.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 552cf5cd00..1f76425cad 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -193,6 +193,16 @@ class TestSyntax < Test::Unit::TestCase end end + def test_keyword_invalid_name + bug11663 = '[ruby-core:71356] [Bug #11663]' + + o = Object.new + assert_syntax_error('def o.foo(arg1?:) end', /arg1\?/, bug11663) + assert_syntax_error('def o.foo(arg1?:, arg2:) end', /arg1\?/, bug11663) + assert_syntax_error('proc {|arg1?:|}', /arg1\?/, bug11663) + assert_syntax_error('proc {|arg1?:, arg2:|}', /arg1\?/, bug11663) + end + def test_optional_self_reference bug9593 = '[ruby-core:61299] [Bug #9593]' o = Object.new |