diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-30 14:43:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-30 14:43:43 +0000 |
commit | c851863a9d2ceea00918fd5d6d935dd4d84679a8 (patch) | |
tree | 1643f84528fc050a5fd85ca6c296680c0bea8b4b /test/ruby | |
parent | c112621e8b1e25ce26dea284f99c1818002d365a (diff) | |
download | ruby-c851863a9d2ceea00918fd5d6d935dd4d84679a8.tar.gz |
parse.y: refine error message
* parse.y (parser_tokadd_utf8): refine error message at bad char
in unicode escape, "invalid" instead of "unterminated".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_unicode_escape.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_unicode_escape.rb b/test/ruby/test_unicode_escape.rb index e0ca430a4a..a7ec3a8ecc 100644 --- a/test/ruby/test_unicode_escape.rb +++ b/test/ruby/test_unicode_escape.rb @@ -256,6 +256,10 @@ EOS assert_raise(SyntaxError) { eval %q("\ughij") } # bad hex digits assert_raise(SyntaxError) { eval %q("\u{ghij}") } # bad hex digits + assert_raise_with_message(SyntaxError, /invalid/) { + eval %q("\u{123.}") # bad char + } + assert_raise(SyntaxError) { eval %q("\u{123 456 }")} # extra space assert_raise(SyntaxError) { eval %q("\u{ 123 456}")} # extra space assert_raise(SyntaxError) { eval %q("\u{123 456}")} # extra space |