mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_enum.rb (test_count): marked as an implementation
specific test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1932c59097
commit
db196eef24
1 changed files with 10 additions and 8 deletions
|
@ -36,6 +36,7 @@ class TestEnumerable < Test::Unit::TestCase
|
||||||
assert_equal(2, @obj.count(1) {|x| x % 2 == 1 })
|
assert_equal(2, @obj.count(1) {|x| x % 2 == 1 })
|
||||||
assert_raise(ArgumentError) { @obj.count(0, 1) }
|
assert_raise(ArgumentError) { @obj.count(0, 1) }
|
||||||
|
|
||||||
|
if RUBY_ENGINE == "ruby"
|
||||||
en = Class.new {
|
en = Class.new {
|
||||||
include Enumerable
|
include Enumerable
|
||||||
alias :size :count
|
alias :size :count
|
||||||
|
@ -45,6 +46,7 @@ class TestEnumerable < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
assert_equal(1, en.new.count, '[ruby-core:24794]')
|
assert_equal(1, en.new.count, '[ruby-core:24794]')
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_find
|
def test_find
|
||||||
assert_equal(2, @obj.find {|x| x % 2 == 0 })
|
assert_equal(2, @obj.find {|x| x % 2 == 0 })
|
||||||
|
|
Loading…
Add table
Reference in a new issue