mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
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
This commit is contained in:
parent
fd7a02f960
commit
a7c4146d9c
3 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue