diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-14 15:37:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-14 15:37:48 +0000 |
commit | 50702d16ab5862413351520b65da820194dbf8d7 (patch) | |
tree | 3dfc239d5db8aebdda3751367d26b1fc3df7d6d7 /test | |
parent | 19ae98d5ce12cd29d5bd276afbfd0a365265121f (diff) | |
download | ruby-50702d16ab5862413351520b65da820194dbf8d7.tar.gz |
parse.y: zero codepoints
* parse.y (parser_tokadd_utf8): relax restriction to allow zero or
more codepoints. fixup r59417.
https://github.com/ruby/ruby/commit/7e8b910#commitcomment-25602670
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_parse.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 8830dbec30..dc461e6599 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -517,6 +517,8 @@ class TestParse < Test::Unit::TestCase assert_syntax_error(src, /:#{__LINE__}: unterminated/o) assert_syntax_error('"\u{100000000}"', /invalid Unicode escape/) + assert_equal("", eval('"\u{}"')) + assert_equal("", eval('"\u{ }"')) assert_equal("\x81", eval('"\C-\M-a"')) assert_equal("\177", eval('"\c?"')) @@ -555,6 +557,10 @@ class TestParse < Test::Unit::TestCase assert_nothing_raised(SyntaxError, bug) do assert_equal(sym, eval(':"foo\u{0}bar"')) end + assert_nothing_raised(SyntaxError) do + assert_equal(:foobar, eval(':"foo\u{}bar"')) + assert_equal(:foobar, eval(':"foo\u{ }bar"')) + end end def test_parse_string |