diff --git a/ChangeLog b/ChangeLog index 0662224a04..b3c3e2d87c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat May 31 20:28:10 2008 Yusuke Endoh + + * test/ruby/test_regexp.rb: add tests. + Sat May 31 19:11:39 2008 NARUSE, Yui * enc/utf_16{be,le}.c (utf16{be,le}_code_to_mbc): 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