diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-24 16:02:52 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-24 16:02:52 +0000 |
commit | 0ec0eb9c5ad780e9aa01b87e0c67144361e0d57c (patch) | |
tree | a77dfa806b593fabec79db8d94b575a465bf2370 /test | |
parent | e097b9b41b2e67000c80e34c349b197ef038a2a5 (diff) |
merge revision(s) 52461: [Backport #11663]
* 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/branches/ruby_2_2@52742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 e4a623208a..cc5ed5f35a 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -184,6 +184,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 |