diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-06 13:53:24 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-06 13:53:24 +0000 |
commit | 774f682952d247297568e905588f26f1849f589b (patch) | |
tree | 222a47bdf8d1025a21d3821652e7a35aae2fa88b /test | |
parent | 9db2bb2a5b820a9d092706cf596e1fae5c429c6f (diff) |
* enum.c: Enumerable#chunk and Enumerable#slice_before no longer takes
the initial_state argument. [Feature #10958]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enum.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index d9b8166f2e..0cb7e93c0a 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -481,22 +481,6 @@ class TestEnumerable < Test::Unit::TestCase e = @obj.chunk {|elt| elt & 2 == 0 ? false : true } assert_equal([[false, [1]], [true, [2, 3]], [false, [1]], [true, [2]]], e.to_a) - e = @obj.chunk(acc: 0) {|elt, h| h[:acc] += elt; h[:acc].even? } - assert_equal([[false, [1,2]], [true, [3]], [false, [1,2]]], e.to_a) - assert_equal([[false, [1,2]], [true, [3]], [false, [1,2]]], e.to_a) # this tests h is duplicated. - - hs = [{}] - e = [:foo].chunk(hs[0]) {|elt, h| - hs << h - true - } - assert_equal([[true, [:foo]]], e.to_a) - assert_equal([[true, [:foo]]], e.to_a) - assert_equal([{}, {}, {}], hs) - assert_not_same(hs[0], hs[1]) - assert_not_same(hs[0], hs[2]) - assert_not_same(hs[1], hs[2]) - e = @obj.chunk {|elt| elt < 3 ? :_alone : true } assert_equal([[:_alone, [1]], [:_alone, [2]], @@ -526,22 +510,6 @@ class TestEnumerable < Test::Unit::TestCase e = @obj.slice_before {|elt| elt.odd? } assert_equal([[1,2], [3], [1,2]], e.to_a) - e = @obj.slice_before(acc: 0) {|elt, h| h[:acc] += elt; h[:acc].even? } - assert_equal([[1,2], [3,1,2]], e.to_a) - assert_equal([[1,2], [3,1,2]], e.to_a) # this tests h is duplicated. - - hs = [{}] - e = [:foo].slice_before(hs[0]) {|elt, h| - hs << h - true - } - assert_equal([[:foo]], e.to_a) - assert_equal([[:foo]], e.to_a) - assert_equal([{}, {}, {}], hs) - assert_not_same(hs[0], hs[1]) - assert_not_same(hs[0], hs[2]) - assert_not_same(hs[1], hs[2]) - ss = %w[abc defg h ijk l mno pqr st u vw xy z] assert_equal([%w[abc defg h], %w[ijk l], %w[mno], %w[pqr st u vw xy z]], ss.slice_before(/\A...\z/).to_a) |