diff options
Diffstat (limited to 'test/ruby')
| -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 cded28cf1f..d1422fc2c0 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1351,6 +1351,14 @@ dummy assert_locations(node.children[-1].locations, [[1, 0, 1, 14], [1, 0, 1, 5]]) end + def test_valias_locations + node = RubyVM::AbstractSyntaxTree.parse("alias $foo $bar") + assert_locations(node.children[-1].locations, [[1, 0, 1, 15], [1, 0, 1, 5]]) + + node = RubyVM::AbstractSyntaxTree.parse("alias $foo $&") + assert_locations(node.children[-1].locations, [[1, 0, 1, 13], [1, 0, 1, 5]]) + end + private def assert_locations(locations, expected) ary = locations.map {|loc| loc && [loc.first_lineno, loc.first_column, loc.last_lineno, loc.last_column] } |
