Add large array test for _.intersection that tests large arrays combined with missing arguments.

This commit is contained in:
John-David Dalton
2014-03-16 01:27:05 -07:00
parent 7d4726d12e
commit 0eeb092aad

View File

@@ -3650,6 +3650,17 @@
deepEqual(_.intersection(expected, largeArray), expected);
});
test('should work with large arrays of objects', 2, function() {
var object = {},
expected = [object],
largeArray = _.times(LARGE_ARRAY_SIZE, _.constant(object));
deepEqual(_.intersection(expected, largeArray), expected);
expected = [1];
deepEqual(_.intersection(_.range(LARGE_ARRAY_SIZE), null, expected), expected);
});
test('should return a wrapped value when chaining', 2, function() {
if (!isNpm) {
var actual = _([1, 3, 2]).intersection([5, 2, 1, 4]);