Skip to content

Commit

Permalink
Close _.difference test coverage gap.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Mar 10, 2014
1 parent f048735 commit 26e1a0c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2120,26 +2120,27 @@
});

test('should work with large arrays', 1, function() {
var array1 = _.range(LARGE_ARRAY_SIZE),
array2 = array1.slice(),
var array1 = _.range(LARGE_ARRAY_SIZE + 1),
array2 = _.range(LARGE_ARRAY_SIZE),
a = {},
b = {},
c = {};

array1.push(a, b, c);
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() {
var object = {};
var object1 = {},
object2 = {};

var largeArray = _.times(LARGE_ARRAY_SIZE, function() {
return object;
});
var largeArray = [object1].concat(_.times(LARGE_ARRAY_SIZE, function() {
return object2;
}));

deepEqual(_.difference(largeArray, [object]), []);
deepEqual(_.difference(largeArray, [object2]), [object1]);
});

test('should ignore individual secondary values', 1, function() {
Expand Down

0 comments on commit 26e1a0c

Please sign in to comment.