diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-01 08:26:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-01 08:26:39 +0000 |
commit | 74495cfa11743a9cd1b27da81968cfbc00538bc4 (patch) | |
tree | 5699146b5d7f33d1588d5152805b1490a9568211 /test/ruby | |
parent | df53b1421bd90b79dda52ab39fff9e06941fa978 (diff) | |
download | ruby-74495cfa11743a9cd1b27da81968cfbc00538bc4.tar.gz |
parse.y: reject invalid codepoint
* parse.y (parser_tokadd_codepoint): reject invalid codepoint,
surrogate blocks and surrogate pair, as well as mruby.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_unicode_escape.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/ruby/test_unicode_escape.rb b/test/ruby/test_unicode_escape.rb index a7ec3a8ecc..108cf804e2 100644 --- a/test/ruby/test_unicode_escape.rb +++ b/test/ruby/test_unicode_escape.rb @@ -264,12 +264,9 @@ EOS assert_raise(SyntaxError) { eval %q("\u{ 123 456}")} # extra space assert_raise(SyntaxError) { eval %q("\u{123 456}")} # extra space -# The utf-8 encoding object currently does not object to codepoints -# in the surrogate blocks, so these do not raise an error. -# assert_raise(SyntaxError) { "\uD800" } # surrogate block -# assert_raise(SyntaxError) { "\uDCBA" } # surrogate block -# assert_raise(SyntaxError) { "\uDFFF" } # surrogate block -# assert_raise(SyntaxError) { "\uD847\uDD9A" } # surrogate pair - + assert_raise(SyntaxError) { eval %q("\uD800") } # surrogate block + assert_raise(SyntaxError) { eval %q("\uDCBA") } # surrogate block + assert_raise(SyntaxError) { eval %q("\uDFFF") } # surrogate block + assert_raise(SyntaxError) { eval %q("\uD847\uDD9A") } # surrogate pair end end |