From c6bac86887b810aff612673fc6027504ac8e4d44 Mon Sep 17 00:00:00 2001 From: mame Date: Sat, 31 May 2008 11:28:49 +0000 Subject: * test/ruby/test_regexp.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_regexp.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3