diff --git a/test/test_set.rb b/test/test_set.rb index 15c5a13d21..cb0727558e 100644 --- a/test/test_set.rb +++ b/test/test_set.rb @@ -476,6 +476,18 @@ class TC_Set < Test::Unit::TestCase assert_equal(Set[1,2,4,5,7,8,10], set) 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 set = Set[1,2,3]