diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-07 16:07:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-07 16:07:25 +0000 |
commit | a7c4146d9cf747792b52cec383ab4d58a0f2b0f9 (patch) | |
tree | cb2509c1d8d4a22a25ff3d17491532181160ff03 /test/ruby/test_parse.rb | |
parent | fd7a02f9600edb4a98498ceb23441a54257f462f (diff) | |
download | ruby-a7c4146d9cf747792b52cec383ab4d58a0f2b0f9.tar.gz |
parse.y: fix invalid char in eval
* parse.y (parser_yylex): fix invalid char in eval, should raise
an syntax error too, as well as directly coded.
[ruby-core:64243] [Bug #10117]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47098 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 8f957bbc58..008dbbcd92 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -657,8 +657,11 @@ x = __ENCODING__ end def test_invalid_char + bug10117 = '[ruby-core:64243] [Bug #10117]' + invalid_char = /Invalid char `\\x01'/ x = 1 - assert_equal(1, eval("\x01x")) + assert_in_out_err(%W"-e \x01x", "", [], invalid_char, bug10117) + assert_syntax_error("\x01x", invalid_char, bug10117) assert_equal(nil, eval("\x04x")) end |