summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorydah <[email protected]>2024-09-22 00:13:16 +0900
committerYuichiro Kaneko <[email protected]>2024-09-23 09:19:37 +0900
commitfeac2b4b77b337a637d80793c53b680e5697cab6 (patch)
tree60fee0d4bd0bb523aa24935abf9ec8a4a73a6b89 /test/ruby
parent02b36f75721aa61d48e3031c71695837d7a8a410 (diff)
Implement CASE NODE keyword locations
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11661
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_ast.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 79077603e4..068b372ff9 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -1353,6 +1353,11 @@ dummy
assert_locations(node.children[-1].children[-1].children[-1].locations, [[1, 7, 1, 14], [1, 7, 1, 12]])
end
+ def test_case_locations
+ node = ast_parse("case a; when 1; end")
+ assert_locations(node.children[-1].locations, [[1, 0, 1, 19], [1, 0, 1, 4], [1, 16, 1, 19]])
+ end
+
def test_next_locations
node = ast_parse("loop { next 1 }")
assert_locations(node.children[-1].children[-1].children[-1].locations, [[1, 7, 1, 13], [1, 7, 1, 11]])