From 1badb09f615b4cb79ca7cc5ebb4736b7b5cccb7e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 15 Sep 2023 09:07:31 -0400 Subject: [ruby/yarp] Properly handle missing method names https://github.com/ruby/yarp/commit/4a30c69051 --- test/yarp/errors_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/yarp/errors_test.rb b/test/yarp/errors_test.rb index feecad7c3f..66a9bcd829 100644 --- a/test/yarp/errors_test.rb +++ b/test/yarp/errors_test.rb @@ -283,7 +283,8 @@ module YARP def test_def_with_expression_receiver_and_no_identifier assert_errors expression("def (a); end"), "def (a); end", [ - ["Expected a `.` or `::` after the receiver in a method definition", 7..7] + ["Expected a `.` or `::` after the receiver in a method definition", 7..7], + ["Expected a method name", 7..7] ] end @@ -291,6 +292,7 @@ module YARP assert_errors expression("def (\na\nb\n).c; end"), "def (\na\nb\n).c; end", [ ["Expected a matching `)`", 7..7], ["Expected a `.` or `::` after the receiver in a method definition", 7..7], + ["Expected a method name", 7..7], ["Cannot parse the expression", 10..10], ["Cannot parse the expression", 11..11] ] -- cgit v1.2.3