Close _.difference test coverage gap.

This commit is contained in:
John-David Dalton
2014-03-10 01:14:11 -07:00
parent 0cbbbf1287
commit 0bdb643e14

View File

@@ -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() {