ruby-changes:5222
From: mame <ko1@a...>
Date: Sat, 31 May 2008 20:34:30 +0900 (JST)
Subject: [ruby-changes:5222] Ruby:r16718 (trunk): * test/ruby/test_regexp.rb: add tests.
mame 2008-05-31 20:28:49 +0900 (Sat, 31 May 2008) New Revision: 16718 Modified files: trunk/ChangeLog trunk/test/ruby/test_regexp.rb Log: * test/ruby/test_regexp.rb: add tests. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16718&r2=16717&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_regexp.rb?r1=16718&r2=16717&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 16717) +++ ChangeLog (revision 16718) @@ -1,3 +1,7 @@ +Sat May 31 20:28:10 2008 Yusuke Endoh <mame@t...> + + * test/ruby/test_regexp.rb: add tests. + Sat May 31 19:11:39 2008 NARUSE, Yui <naruse@r...> * enc/utf_16{be,le}.c (utf16{be,le}_code_to_mbc): Index: test/ruby/test_regexp.rb =================================================================== --- test/ruby/test_regexp.rb (revision 16717) +++ test/ruby/test_regexp.rb (revision 16718) @@ -669,4 +669,11 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/