* test/ruby/test_array.rb (test_count): add a test case for #count

with an argument. See Bug #8654.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2013-07-18 15:55:04 +00:00
parent 2de786d437
commit 632b85a391
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Fri Jul 19 00:54:27 2013 Benoit Daloze <eregontp@gmail.com>
* test/ruby/test_array.rb (test_count): add a test case for #count
with an argument. See Bug #8654.
Thu Jul 18 23:45:06 2013 Masaki Matsushita <glass.saga@gmail.com>
* array.c (rb_ary_eql): compare RARRAY_PTR() for performance

View File

@ -582,6 +582,18 @@ class TestArray < Test::Unit::TestCase
a2.replace(a1) if i == 0
end
EOS
assert_in_out_err [], <<-EOS, ["[]", "0"], [], bug8654
ARY = Array.new(100) { |i| i }
class Fixnum
def == other
ARY.replace([]) if self.equal?(0)
p ARY
self.equal?(other)
end
end
p ARY.count(42)
EOS
end
def test_delete