summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-05 16:44:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-05 16:44:43 +0900
commit1f544d671580dab465df56f42e142db4667f782e (patch)
tree2a89d6c51fe82f14846f82f1c1195b363a88d5ed /test/ruby
parent5a961c37682383d5d439a16b912be62cd2d0a7f0 (diff)
Show the last line at unexpected end-of-input error
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_parse.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index 625b6eb223..a9e8417357 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -1162,6 +1162,10 @@ x = __ENCODING__
assert_syntax_error("def m\n\C-z""end", /unexpected/)
end
+ def test_unexpected_eof
+ assert_syntax_error('unless', /^ \^\Z/)
+ end
+
def test_location_of_invalid_token
assert_syntax_error('class xxx end', /^ \^~~\Z/)
end