From 36ee0c1acb45760d63fc7dcb9a4d2b6002a58a4f Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Mar 2025 00:14:25 +0900 Subject: [PATCH] Add tests for alias locations with special variables $`, $', and $+ --- test/ruby/test_ast.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 68db05c07e..86676ac577 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1570,6 +1570,15 @@ dummy node = ast_parse("alias $foo $&") assert_locations(node.children[-1].locations, [[1, 0, 1, 13], [1, 0, 1, 5]]) + + node = ast_parse("alias $foo $`") + assert_locations(node.children[-1].locations, [[1, 0, 1, 13], [1, 0, 1, 5]]) + + node = ast_parse("alias $foo $'") + assert_locations(node.children[-1].locations, [[1, 0, 1, 13], [1, 0, 1, 5]]) + + node = ast_parse("alias $foo $+") + assert_locations(node.children[-1].locations, [[1, 0, 1, 13], [1, 0, 1, 5]]) end def test_when_locations