mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_array.rb: add test for find_all. (based on Daniel Berger's patch)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
60d5e3b196
commit
8d773f686e
2 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,8 @@ Fri May 13 12:28:43 2005 Daniel Berger <djberge@qwest.com>
|
|||
|
||||
* array.c (rb_ary_select): can remove argc check. [ruby-core:4911]
|
||||
|
||||
* test/ruby/test_array.rb: add test for find_all.
|
||||
|
||||
Fri May 13 11:29:00 2005 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* eval.c (unknown_node): add volatile directive to prototype.
|
||||
|
|
|
@ -98,4 +98,14 @@ class TestArray < Test::Unit::TestCase
|
|||
x.concat(x)
|
||||
assert_equal([1,2,3,1,2,3], x)
|
||||
end
|
||||
|
||||
def test_find_all
|
||||
assert_respond_to([], :find_all)
|
||||
assert_respond_to([], :select) # Alias
|
||||
assert_equal([], [].find_all{ |obj| obj == "foo"})
|
||||
|
||||
x = ["foo", "bar", "baz", "baz", 1, 2, 3, 3, 4]
|
||||
assert_equal(["baz","baz"], x.find_all{ |obj| obj == "baz" })
|
||||
assert_equal([3,3], x.find_all{ |obj| obj == 3 })
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue