diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2023-09-15 09:07:31 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-09-15 15:14:19 +0000 |
| commit | 1badb09f615b4cb79ca7cc5ebb4736b7b5cccb7e (patch) | |
| tree | c3880e5e5c1e55e6b0e110b97f9d8fd5d4432be8 /test | |
| parent | 89802078f9f406be411032814e1960e62dbc7ce2 (diff) | |
[ruby/yarp] Properly handle missing method names
https://github.com/ruby/yarp/commit/4a30c69051
Diffstat (limited to 'test')
| -rw-r--r-- | test/yarp/errors_test.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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] ] |
