diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-12-01 13:04:42 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-12-01 15:04:30 +0900 |
| commit | d503e1b95a40e45d7767e0175de60092de4ba54e (patch) | |
| tree | 3804881a722be63f4a2b6952cf6f6198fd615c80 /test/ruby | |
| parent | 52c2660163240a494b65eb9942c3978896ed807b (diff) | |
[Bug #20030] dispatch invalid escaped character without ignoring it
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_parse.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 2960a3c295..6121205857 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -603,6 +603,10 @@ class TestParse < Test::Unit::TestCase assert_equal(' ^~~~~'"\n", e.message.lines.last) e = assert_syntax_error('"\M-\U0000"', 'Invalid escape character syntax') assert_equal(' ^~~~~'"\n", e.message.lines.last) + + e = assert_syntax_error(%["\\C-\u3042"], 'Invalid escape character syntax') + assert_match(/^\s \^(?# \\ ) ~(?# C ) ~(?# - ) ~+(?# U+3042 )$/x, e.message.lines.last) + assert_not_include(e.message, "invalid multibyte char") end def test_question |
