зеркало из https://github.com/github/ruby.git
* test/test_set.rb: add missing test of Set#select!.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8ef6dacb24
Коммит
315a136ec0
|
@ -476,6 +476,18 @@ class TC_Set < Test::Unit::TestCase
|
||||||
assert_equal(Set[1,2,4,5,7,8,10], set)
|
assert_equal(Set[1,2,4,5,7,8,10], set)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_select!
|
||||||
|
set = Set.new(1..10)
|
||||||
|
ret = set.select! { |i| i <= 10 }
|
||||||
|
assert_equal(nil, ret)
|
||||||
|
assert_equal(Set.new(1..10), set)
|
||||||
|
|
||||||
|
set = Set.new(1..10)
|
||||||
|
ret = set.select! { |i| i % 3 != 0 }
|
||||||
|
assert_same(set, ret)
|
||||||
|
assert_equal(Set[1,2,4,5,7,8,10], set)
|
||||||
|
end
|
||||||
|
|
||||||
def test_merge
|
def test_merge
|
||||||
set = Set[1,2,3]
|
set = Set[1,2,3]
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче