diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-16 23:45:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-16 23:45:48 +0000 |
commit | 3ae53aa5f8eb9664690e07857db60b21500fd07d (patch) | |
tree | 7b11636fb928173fcf65f962453e4d19aca2d9e0 /test/ruby/test_parse.rb | |
parent | d8f48f2cb40138e63e8404e9065893b5719a44f9 (diff) | |
download | ruby-3ae53aa5f8eb9664690e07857db60b21500fd07d.tar.gz |
parse.y: refine invalid Unicode escape message
* parse.y (literal_flush): rename from numeric_literal_flush, as
it is not just for numerics now.
* parse.y (parser_tokadd_codepoint): show invalid character
position, but not the start of Unicode escape.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index b3795a4ac4..7ce236679c 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -490,7 +490,10 @@ class TestParse < Test::Unit::TestCase assert_equal(' ^', e.message.lines.last, mesg) e = assert_syntax_error('"\u{1234"', 'Unicode escape') - assert_match(' ^~~~~~~', e.message.lines.last, mesg) + assert_match(' ^', e.message.lines.last, mesg) + + e = assert_syntax_error('"\u{xxxx}"', 'invalid Unicode escape') + assert_match(' ^', e.message.lines.last, mesg) e = assert_syntax_error('"\M1"', /escape character syntax/) assert_equal(' ^~~', e.message.lines.last, mesg) |