mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Close _.difference test coverage gap.
This commit is contained in:
17
test/test.js
17
test/test.js
@@ -2120,8 +2120,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should work with large arrays', 1, function() {
|
test('should work with large arrays', 1, function() {
|
||||||
var array1 = _.range(LARGE_ARRAY_SIZE),
|
var array1 = _.range(LARGE_ARRAY_SIZE + 1),
|
||||||
array2 = array1.slice(),
|
array2 = _.range(LARGE_ARRAY_SIZE),
|
||||||
a = {},
|
a = {},
|
||||||
b = {},
|
b = {},
|
||||||
c = {};
|
c = {};
|
||||||
@@ -2129,17 +2129,18 @@
|
|||||||
array1.push(a, b, c);
|
array1.push(a, b, c);
|
||||||
array2.push(b, c, a);
|
array2.push(b, c, a);
|
||||||
|
|
||||||
deepEqual(_.difference(array1, array2), []);
|
deepEqual(_.difference(array1, array2), [LARGE_ARRAY_SIZE]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should work with large arrays of objects', 1, function() {
|
test('should work with large arrays of objects', 1, function() {
|
||||||
var object = {};
|
var object1 = {},
|
||||||
|
object2 = {};
|
||||||
|
|
||||||
var largeArray = _.times(LARGE_ARRAY_SIZE, function() {
|
var largeArray = [object1].concat(_.times(LARGE_ARRAY_SIZE, function() {
|
||||||
return object;
|
return object2;
|
||||||
});
|
}));
|
||||||
|
|
||||||
deepEqual(_.difference(largeArray, [object]), []);
|
deepEqual(_.difference(largeArray, [object2]), [object1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should ignore individual secondary values', 1, function() {
|
test('should ignore individual secondary values', 1, function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user