diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-04-04 23:07:45 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-04-04 23:07:45 +0000 |
commit | 6638b504b1ea1d092a75d02aa20674e540dd4b53 (patch) | |
tree | eb4ccda1f0224407af24d5d77c46244ce48ec9a2 /test | |
parent | 942129cdba1c2f36b7c4f0539df9b1d3e56339e4 (diff) |
merge revision(s) 8e189df32cacef4b21e357a590d349330532baf5: [Backport #17013]
Add operator info to OP_ASGN2 of RubyVM::AbstractSyntaxTree.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_ast.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 1a897ef502..3ba67e69a2 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -269,4 +269,15 @@ class TestAst < Test::Unit::TestCase assert_equal(:LIT, body.type) assert_equal([1], body.children) end + + def test_op_asgn2 + node = RubyVM::AbstractSyntaxTree.parse("struct.field += foo") + _, _, body = *node.children + assert_equal(:OP_ASGN2, body.type) + recv, _, mid, op, value = body.children + assert_equal(:VCALL, recv.type) + assert_equal(:field, mid) + assert_equal(:+, op) + assert_equal(:VCALL, value.type) + end end |