diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-11 12:53:45 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-11 12:53:45 +0000 |
| commit | c093d46f4f217b0e8f6ba683f12a3c287ae60eec (patch) | |
| tree | a6ba6bfa880609c48eeb665860d805d0ee84e63f /test/ruby | |
| parent | 927c116d0c098a28082a22b15d7daa26ed560591 (diff) | |
merge revision(s) 57198: [Backport #13073]
parse.y: preserve cmdarg stack
* parse.y (do_body): preserve cmdarg stack around do/end block.
[ruby-core:78837] [Bug #13073]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_syntax.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 3e6212e27c..f40f15316b 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -917,6 +917,15 @@ eom end end + def test_do_block_in_hash_brace + bug13073 = '[ruby-core:78837] [Bug #13073]' + assert_valid_syntax 'p :foo, {a: proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {:a => proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {"a": proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {** proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {proc do end => proc do end, b: proc do end}', bug13073 + end + def test_do_after_local_variable obj = Object.new def obj.m; yield; end |
