1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_regexp.rb: add tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2008-05-31 11:28:49 +00:00
parent 0682fab6a2
commit c6bac86887
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Sat May 31 20:28:10 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_regexp.rb: add tests.
Sat May 31 19:11:39 2008 NARUSE, Yui <naruse@ruby-lang.org>
* enc/utf_16{be,le}.c (utf16{be,le}_code_to_mbc):

View file

@ -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