diff options
| author | tompng <tomoyapenguin@gmail.com> | 2024-10-05 15:18:45 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu.nakada@gmail.com> | 2024-10-05 15:59:01 +0900 |
| commit | 6743e6285a585fbd0a3b25b8eeed10caf1fae66e (patch) | |
| tree | d563fe63b848a747678818e3704c795ebbea1166 /test | |
| parent | e939f28cc93a538e751c9c1200c95c4c85c9d09b (diff) | |
[Bug #20784] Fix incomplete character syntax followed by EOF
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11805
Diffstat (limited to 'test')
| -rw-r--r-- | test/ripper/test_scanner_events.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index 261e259889..ed291c4384 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -952,6 +952,10 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase scan('CHAR', "?\\u{41}") err = nil + assert_equal [], scan('CHAR', '?\\') {|*e| err = e} + assert_equal([:on_parse_error, "Invalid escape character syntax", "?\\"], err) + + err = nil assert_equal [], scan('CHAR', '?\\M ') {|*e| err = e} assert_equal([:on_parse_error, "Invalid escape character syntax", "?\\M "], err) |
