summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-31 11:28:49 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-31 11:28:49 +0000
commitc6bac86887b810aff612673fc6027504ac8e4d44 (patch)
treea82404d96600ee5ccb8235d94d7328f674d1629e /test
parent0682fab6a2ad52f51a440336e99a9abe28e7c050 (diff)
* test/ruby/test_regexp.rb: add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_regexp.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 45a93c8971..52f931532b 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -669,4 +669,11 @@ class TestRegexp < Test::Unit::TestCase
failcheck('[[:alpha:')
failcheck('[[:alp:]]')
end
+
+ def test_backward
+ assert_equal(3, "foobar".rindex(/b.r/i))
+ assert_equal(nil, "foovar".rindex(/b.r/i))
+ assert_equal(3, ("foo" + "bar" * 1000).rindex(/#{"bar"*1000}/))
+ assert_equal(4, ("foo\nbar\nbaz\n").rindex(/bar/i))
+ end
end