summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormanga_osyo <manga.osyo@gmail.com>2020-07-05 20:58:55 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-06 00:48:15 +0900
commit8e189df32cacef4b21e357a590d349330532baf5 (patch)
tree16c98959902e4a00baced105bf566d6bcf58beb0 /test
parent988b4bc9eab1e22e4bef7812e878c8ef4ed5ac0f (diff)
Add operator info to `OP_ASGN2` of `RubyVM::AbstractSyntaxTree`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3294
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_ast.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 147d05eadf..da7dde4a38 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -319,4 +319,15 @@ class TestAst < Test::Unit::TestCase
helper.validate_range
assert_equal([], helper.errors)
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