mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (parser_read_escape): deny extra character escapes.
[ruby-core:27228] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
87ba383aa3
commit
422efe5352
3 changed files with 14 additions and 0 deletions
|
@ -52,6 +52,13 @@ class TestRubyLiteral < Test::Unit::TestCase
|
|||
assert_equal "\1", "\1"
|
||||
assert_equal "3", "\x33"
|
||||
assert_equal "\n", "\n"
|
||||
bug2500 = '[ruby-core:27228]'
|
||||
%w[c C- M-].each do |pre|
|
||||
["u", "x", %w[u{ }]].each do |open, close|
|
||||
str = "\"\\#{pre}\\#{open}5555#{close}\""
|
||||
assert_raise(SyntaxError, "#{bug2500} eval(#{str})") {eval(str)}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_dstring
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue