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 | b17efb6874345c2dc8dc41f76226463b9a785123 (patch) | |
tree | 7b11636fb928173fcf65f962453e4d19aca2d9e0 /test | |
parent | 26888a8ee7029cfafad69c895e4919641917fae1 (diff) | |
download | ruby-b17efb6874345c2dc8dc41f76226463b9a785123.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')
-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) |