From d60144a4908b9bd64f7cd635defaa68b2abf2638 Mon Sep 17 00:00:00 2001 From: ydah Date: Sun, 3 Nov 2024 01:43:21 +0900 Subject: Implement COLON3 NODE locations --- test/ruby/test_ast.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 74eb217791..d22823470b 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1406,6 +1406,15 @@ dummy assert_locations(node.children[-1].children[0].locations, [[1, 0, 1, 4], [1, 1, 1, 3], [1, 3, 1, 4]]) end + def test_colon3_locations + node = ast_parse("::A") + assert_locations(node.children[-1].locations, [[1, 0, 1, 3], [1, 0, 1, 2], [1, 2, 1, 3]]) + + node = ast_parse("::A::B") + assert_locations(node.children[-1].locations, [[1, 0, 1, 6], [1, 3, 1, 5], [1, 5, 1, 6]]) + assert_locations(node.children[-1].children[0].locations, [[1, 0, 1, 3], [1, 0, 1, 2], [1, 2, 1, 3]]) + end + def test_dot2_locations node = ast_parse("1..2") assert_locations(node.children[-1].locations, [[1, 0, 1, 4], [1, 1, 1, 3]]) -- cgit v1.2.3