summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-04 14:21:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-04 14:21:13 +0000
commit68a16f9a2dfbb773744adaa63468449838761015 (patch)
tree01dc68d437495d694af5e8eee928f3d909229b52 /test/ruby/test_regexp.rb
parentb212b84fc1ebe42e559a078ef9e78e9b7e51907b (diff)
* parse.y (parser_tokadd_string): regexp engine doesn't need
terminators to be escaped. [ruby-core:40364][Bug #5484] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index b1490ed06d..a86e8c2584 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -155,7 +155,10 @@ class TestRegexp < Test::Unit::TestCase
end
def test_source
+ bug5484 = ']ruby-core:40364]'
assert_equal('', //.source)
+ assert_equal('\:', /\:/.source, bug5484)
+ assert_equal(':', %r:\::.source, bug5484)
end
def test_inspect
@@ -369,9 +372,11 @@ class TestRegexp < Test::Unit::TestCase
end
def test_equal
- assert_equal(true, /abc/ == /abc/)
- assert_equal(false, /abc/ == /abc/m)
- assert_equal(false, /abc/ == /abd/)
+ bug5484 = ']ruby-core:40364]'
+ assert_equal(/abc/, /abc/)
+ assert_not_equal(/abc/, /abc/m)
+ assert_not_equal(/abc/, /abd/)
+ assert_equal(/\/foo/, Regexp.new('/foo'), bug5484)
end
def test_match