summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 01:54:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 01:54:23 +0000
commit422efe53527f5e0a7a80478947a7b338e8b199c7 (patch)
treed32ffbff8f870d95c767f51cae2bf0e620a6b529 /test
parent87ba383aa38dbf81b6aa3fa9c771e7ac715f3c96 (diff)
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_literal.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index 80c8af9312..b4480f725a 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -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