diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-13 02:10:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-13 02:10:11 +0000 |
commit | 90d9255ec24b84a1a9f975f2628530f0ed80636d (patch) | |
tree | c7d67b9dc63c2534b4f02c5f09fef482de30733c /test | |
parent | 5245e314264ad3297f1203ba0beb40b060b22ed3 (diff) |
parse.y: chained assignments
* parse.y (command_asgn, arg): fix syntax errors with chained
assignment with op assign. [Bug #12669]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_assignment.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb index 41c14d3a44..45c4d6e058 100644 --- a/test/ruby/test_assignment.rb +++ b/test/ruby/test_assignment.rb @@ -771,4 +771,14 @@ class TestAssignmentGen < Test::Unit::TestCase h[*k], = ["ok", "ng"] assert_equal("ok", h[:key], bug11970) end + + def test_chainged_assign_command + all_assertions do |a| + asgn = %w'= +=' + asgn.product(asgn) do |a1, a2| + stmt = "a #{a1} b #{a2} raise 'x'" + a.for(stmt) {assert_valid_syntax(stmt)} + end + end + end end |