Change default size of _.chunk to 0.

This commit is contained in:
John-David Dalton
2015-07-28 13:49:55 -07:00
parent 48a6c4f2bf
commit 5fb732c0e6
2 changed files with 11 additions and 18 deletions

View File

@@ -1794,9 +1794,9 @@
deepEqual(actual, [[0, 1, 2, 3], [4, 5]]);
});
test('should ensure the minimum `chunkSize` is `1`', 1, function() {
test('should ensure the minimum `size` is `0`', 1, function() {
var values = falsey.concat(-1, -Infinity),
expected = _.map(values, _.constant([[0], [1], [2], [3], [4], [5]]));
expected = _.map(values, _.constant([]));
var actual = _.map(values, function(value, index) {
return index ? _.chunk(array, value) : _.chunk(array);
@@ -1808,11 +1808,6 @@
test('should floor `size` values', 1, function() {
deepEqual(_.chunk(array, array.length / 4), [[0], [1], [2], [3], [4], [5]]);
});
test('should work as an iteratee for methods like `_.map`', 1, function() {
var actual = _.map([[1, 2], [3, 4]], _.chunk);
deepEqual(actual, [[[1], [2]], [[3], [4]]]);
});
}());
/*--------------------------------------------------------------------------*/