Simplify _.zip for the underscore build.

Former-commit-id: 18560e78f052fad5c5d7af1ef6571dd31accf690
This commit is contained in:
John-David Dalton
2013-07-08 08:29:18 -07:00
parent ee01c944b4
commit 36488fd836
5 changed files with 26 additions and 7 deletions

View File

@@ -1079,6 +1079,10 @@
deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename);
strictEqual(lodash.findWhere(collection, {}), null, '_.findWhere should return `null` for falsey `properties`: ' + basename);
var expected = [[['moe', 30, true]], [['larry', 40, false]]];
actual = lodash.unzip(lodash.zip(['moe', 'larry'], [30, 40], [true, false]));
deepEqual(actual, expected, '_.zip is unable to correctly consume it\'s output: ' + basename);
start();
});
});
@@ -1577,7 +1581,8 @@
'uniq',
'uniqueId',
'value',
'where'
'where',
'zip'
];
function strip(value) {

View File

@@ -3513,7 +3513,7 @@
deepEqual(actual, [['moe', 30, undefined], ['larry', 40, false]]);
});
test('should be able to consume the output of `_.unzip`', function() {
test('should correctly consume it\'s output', function() {
var expected = [['moe', 'larry'], [30, 40]];
deepEqual(_.unzip(_.zip(_.unzip(_.zip(expected)))), expected);
});