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 38c0d56a0f..940c4de9d7 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -1348,6 +1348,14 @@ dummy
assert_locations(node.children[-1].locations, [[1, 0, 1, 6], [1, 2, 1, 4]])
end
+ def test_block_pass_locations
+ node = ast_parse("foo(&bar)")
+ assert_locations(node.children[-1].children[-1].locations, [[1, 4, 1, 8], [1, 4, 1, 5]])
+
+ node = ast_parse("def a(&); b(&) end")
+ assert_locations(node.children[-1].children[-1].children[-1].children[-1].children[-1].locations, [[1, 12, 1, 13], [1, 12, 1, 13]])
+ end
+
def test_break_locations
node = ast_parse("loop { break 1 }")
assert_locations(node.children[-1].children[-1].children[-1].locations, [[1, 7, 1, 14], [1, 7, 1, 12]])