summaryrefslogtreecommitdiff
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 15:55:04 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 15:55:04 +0000
commit632b85a3914cd94125efc35f4aecdf1f82641323 (patch)
tree0e4e8971d24a3c1c1b24c63eab67b5d02bb67192 /test/ruby/test_array.rb
parent2de786d43756dc16ee43e5a8b280fec6f6cfc589 (diff)
* 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
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index b158db0ec9..fdb4c60d59 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -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