From 0eeb092aad075461674256c39a80828ef597f648 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 16 Mar 2014 01:27:05 -0700 Subject: [PATCH] Add large array test for `_.intersection` that tests large arrays combined with missing arguments. --- test/test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test.js b/test/test.js index e04576004..d7bd19e70 100644 --- a/test/test.js +++ b/test/test.js @@ -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]);