зеркало из https://github.com/github/ruby.git
Add some corner cases to tests for String#index.
* test/ruby/test_string.rb (TestString#test_index): Add some corner cases to tests for String#index, which might fail if ruby directly used a buggy memmem(3) implementation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
cda3a0c75e
Коммит
9cbaeed6ed
|
@ -1,3 +1,9 @@
|
|||
Thu Nov 22 12:52:19 2012 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* test/ruby/test_string.rb (TestString#test_index): Add some
|
||||
corner cases to tests for String#index, which might fail if ruby
|
||||
directly used a buggy memmem(3) implementation.
|
||||
|
||||
Thu Nov 22 08:06:42 2012 Narihiro Nakamura <authornari@gmail.com>
|
||||
|
||||
* test/ruby/test_gc.rb (test_profiler_clear): fix wrong method
|
||||
|
|
|
@ -830,6 +830,13 @@ class TestString < Test::Unit::TestCase
|
|||
assert_nil(S("hello").index(S("z")))
|
||||
assert_nil(S("hello").index(/z./))
|
||||
|
||||
assert_equal(0, S("").index(S("")))
|
||||
assert_equal(0, S("").index(//))
|
||||
assert_nil(S("").index(S("hello")))
|
||||
assert_nil(S("").index(/hello/))
|
||||
assert_equal(0, S("hello").index(S("")))
|
||||
assert_equal(0, S("hello").index(//))
|
||||
|
||||
o = Object.new
|
||||
def o.to_str; "bar"; end
|
||||
assert_equal(3, "foobarbarbaz".index(o))
|
||||
|
|
Загрузка…
Ссылка в новой задаче