diff options
| author | ydah <t.yudai92@gmail.com> | 2024-09-27 02:01:08 +0900 |
|---|---|---|
| committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2024-09-27 18:20:00 +0900 |
| commit | eff16d93025d354de08cb40a11a51acffdf26e57 (patch) | |
| tree | 6ee875111828084ef0276207f02f6d039014b54a /test | |
| parent | a70adce1ce5fae8eaae385214ac0d2e7d17c1103 (diff) | |
Implement OP_ASGN1 NODE locations
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11701
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_ast.rb | 8 |
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]]) |
