summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_ast.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 940c4de9d7..f1328b15ed 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -1381,6 +1381,14 @@ dummy
assert_locations(node.children[-1].children[-1].children[-1].locations, [[1, 7, 1, 13], [1, 7, 1, 11]])
end
+ def test_op_asgn1_locations
+ node = ast_parse("ary[1] += foo")
+ assert_locations(node.children[-1].locations, [[1, 0, 1, 13], nil, [1, 3, 1, 4], [1, 5, 1, 6], [1, 7, 1, 9]])
+
+ node = ast_parse("ary[1, 2] += foo")
+ assert_locations(node.children[-1].locations, [[1, 0, 1, 16], nil, [1, 3, 1, 4], [1, 8, 1, 9], [1, 10, 1, 12]])
+ end
+
def test_or_locations
node = ast_parse("1 or 2")
assert_locations(node.children[-1].locations, [[1, 0, 1, 6], [1, 2, 1, 4]])