summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEarlopain <14981592+Earlopain@users.noreply.github.com>2026-01-15 21:47:26 +0100
committergit <svn-admin@ruby-lang.org>2026-01-15 21:15:34 +0000
commitc34c7def5a13bcc60b09c1fc11267a6fdca700ba (patch)
treecf9db05912fd03237ededa60fae5988a97e7b42e /test
parent15939e3c30b9ab5e8623a8f78e4249b0e935bf3f (diff)
[ruby/prism] Fix locations for invalid syntax when using `expect1_opening`
Followup to https://github.com/ruby/prism/pull/3827 It sets the start to the opening but it should instead just continue on as usual. Fixes https://github.com/ruby/prism/issues/3851 Notice how the AST actually contains "123" in both the body and end keyword. https://github.com/ruby/prism/commit/8f69c5af08
Diffstat (limited to 'test')
-rw-r--r--test/prism/errors_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb
index 706b739557..aa264ae5b7 100644
--- a/test/prism/errors_test.rb
+++ b/test/prism/errors_test.rb
@@ -82,6 +82,11 @@ module Prism
assert_empty result.errors
end
+ def test_incomplete_def_closing_loc
+ statement = Prism.parse_statement("def f; 123")
+ assert_empty(statement.end_keyword)
+ end
+
private
def assert_errors(filepath, version)