diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-30 14:33:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-30 14:33:38 +0000 |
commit | 77df5bb1b5ab3e4d6ed32d0b43acb69b3167f5dd (patch) | |
tree | db8c33e6c55542025a1c378cc40bf3cae9a5ff69 /test | |
parent | a6c637f013b7a4031df13a56fdb00560369d2aa8 (diff) | |
download | ruby-77df5bb1b5ab3e4d6ed32d0b43acb69b3167f5dd.tar.gz |
parse.y: escaped closing parenthsis
* parse.y (simple_re_meta): escaped closing parenthsis has different
meaning. [Bug #7610] [ruby-core:51088]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_regexp.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 03c7fd4443..faafe336ec 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -179,6 +179,12 @@ class TestRegexp < Test::Unit::TestCase assert_equal(expected, result) end + def test_source_escaped_paren + bug7610 = '[ruby-core:51088]' + s = '\(a\)' + assert_equal(/#{s}/, eval("%r(#{s})"), bug7610) + end + def test_source_unescaped expected, result = "!\"#%&',-/:;=@_`~".each_char.map {|c| [ |