Lines Matching refs:deepEqual

9     assert.deepEqual(_.first([1, 2, 3], 0), [], 'returns an empty array when n <= 0 (0 case)');
10 …assert.deepEqual(_.first([1, 2, 3], -1), [], 'returns an empty array when n <= 0 (negative case)');
11 assert.deepEqual(_.first([1, 2, 3], 2), [1, 2], 'can fetch the first n elements');
12 assert.deepEqual(_.first([1, 2, 3], 5), [1, 2, 3], 'returns the whole array if n > length');
16 assert.deepEqual(result, [1, 1], 'works well with _.map');
34 assert.deepEqual(_.rest(numbers), [2, 3, 4], 'fetches all but the first element');
35 assert.deepEqual(_.rest(numbers, 0), [1, 2, 3, 4], 'returns the whole array when index is 0');
36 assert.deepEqual(_.rest(numbers, 2), [3, 4], 'returns elements starting at the given index');
38 assert.deepEqual(result, [2, 3, 4], 'works on an arguments object');
40 assert.deepEqual(_.flatten(result), [2, 3, 2, 3], 'works well with _.map');
52 assert.deepEqual(_.initial([1, 2, 3, 4, 5]), [1, 2, 3, 4], 'returns all but the last element');
53 assert.deepEqual(_.initial([1, 2, 3, 4], 2), [1, 2], 'returns all but the last n elements');
54 assert.deepEqual(_.initial([1, 2, 3, 4], 6), [], 'returns an empty array when n > length');
56 assert.deepEqual(result, [1, 2, 3], 'works on an arguments object');
58 assert.deepEqual(_.flatten(result), [1, 2, 1, 2], 'works well with _.map');
64 assert.deepEqual(_.last([1, 2, 3], 0), [], 'returns an empty array when n <= 0 (0 case)');
65 … assert.deepEqual(_.last([1, 2, 3], -1), [], 'returns an empty array when n <= 0 (negative case)');
66 assert.deepEqual(_.last([1, 2, 3], 2), [2, 3], 'can fetch the last n elements');
67 assert.deepEqual(_.last([1, 2, 3], 5), [1, 2, 3], 'returns the whole array if n > length');
71 assert.deepEqual(result, [3, 3], 'works well with _.map');
80 …assert.deepEqual(_.compact([1, false, null, 0, '', void 0, NaN, 2]), [1, 2], 'removes all falsy va…
82 assert.deepEqual(result, [1, 2, 3], 'works on an arguments object');
84 assert.deepEqual(result, [[1], [3]], 'works well with _.map');
88 assert.deepEqual(_.flatten(null), [], 'supports null');
89 assert.deepEqual(_.flatten(void 0), [], 'supports undefined');
91 assert.deepEqual(_.flatten([[], [[]], []]), [], 'supports empty arrays');
92 assert.deepEqual(_.flatten([[], [[]], []], true), [[]], 'can shallowly flatten empty arrays');
95 assert.deepEqual(_.flatten(list), [1, 2, 3, 4], 'can flatten nested arrays');
96 …assert.deepEqual(_.flatten(list, true), [1, 2, 3, [[[4]]]], 'can shallowly flatten nested arrays');
98 assert.deepEqual(result, [1, 2, 3, 4], 'works on an arguments object');
100 …assert.deepEqual(_.flatten(list, true), [1, 2, 3, [4]], 'can shallowly flatten arrays containing o…
109 assert.deepEqual(_.flatten(x), _.range(100000), 'can handle very deep arrays');
110 assert.deepEqual(_.flatten(x, true), x[0], 'can handle very deep arrays in shallow mode');
115 assert.deepEqual(_.without(list, 0, 1), [2, 3, 4], 'removes all instances of the given values');
117 assert.deepEqual(result, [2, 3, 4], 'works on an arguments object');
120 assert.deepEqual(_.without(list, {one: 1}), list, 'compares objects by reference (value case)');
121 …assert.deepEqual(_.without(list, list[0]), [{two: 2}], 'compares objects by reference (reference c…
153 assert.deepEqual(_.uniq(list), [1, 2, 3, 4], 'can find the unique values of an unsorted array');
155 …assert.deepEqual(_.uniq(list, true), [1, 2, 3], 'can find the unique values of a sorted array fast…
160 …assert.deepEqual(_.uniq(list, false, iterator), expected, 'uses the result of `iterator` for uniqu…
161 …assert.deepEqual(_.uniq(list, iterator), expected, '`sorted` argument defaults to false when omitt…
162 …assert.deepEqual(_.uniq(list, 'name'), expected, 'when `iterator` is a string, uses that key for c…
167 …assert.deepEqual(_.uniq(list, true, iterator), expected, 'uses the result of `iterator` for unique…
168 …assert.deepEqual(_.uniq(list, true, 'score'), expected, 'when `iterator` is a string, uses that ke…
170 …assert.deepEqual(_.uniq([{0: 1}, {0: 1}, {0: 1}, {0: 2}], 0), [{0: 1}, {0: 2}], 'can use falsey pl…
173 assert.deepEqual(result, [1, 2, 3, 4], 'works on an arguments object');
176 …assert.deepEqual(_.uniq([a, b, a, b, c]), [a, b, c], 'works on values that can be tested for equiv…
178 assert.deepEqual(_.uniq(null), [], 'returns an empty array when `array` is not iterable');
197 …assert.deepEqual(_.intersection(stooges, leaders), ['moe'], 'can find the set intersection of two …
198 …assert.deepEqual(_(stooges).intersection(leaders), ['moe'], 'can perform an OO-style intersection'…
200 assert.deepEqual(result, ['moe'], 'works on an arguments object');
202 …assert.deepEqual(_.intersection(theSixStooges, leaders), ['moe'], 'returns a duplicate-free array'…
204 assert.deepEqual(result, [2, 3, 1], 'preserves the order of the first array');
206 assert.deepEqual(result, [], 'returns an empty array when passed null as the first argument');
208 …assert.deepEqual(result, [], 'returns an empty array when passed null as an argument beyond the fi…
213 assert.deepEqual(result, [1, 2, 3, 30, 40], 'can find the union of a list of arrays');
216 assert.deepEqual(result, [1, 2, 3, 30, 40], 'can perform an OO-style union');
219 … assert.deepEqual(result, [1, 2, 3, 30, 40, [1]], 'can find the union of a list of nested arrays');
222 assert.deepEqual(result, [10, 20, 1, 30, 0, 40], 'orders values by their first encounter');
225 assert.deepEqual(result, [1, 2, 3, 30, 40], 'works on an arguments object');
227 assert.deepEqual(_.union([1, 2, 3], 4), [1, 2, 3], 'restricts the union to arrays only');
232 assert.deepEqual(result, [1, 3], 'can find the difference of two arrays');
235 assert.deepEqual(result, [1, 3], 'can perform an OO-style difference');
238 assert.deepEqual(result, [3, 4], 'can find the difference of three arrays');
241 assert.deepEqual(result, [9, 1], 'preserves the order of the first array');
244 assert.deepEqual(result, [1, 3], 'works on an arguments object');
247 assert.deepEqual(result, [1, 2, 3], 'restrict the difference to arrays only');
252 assert.deepEqual(_.zip(names, ages, leaders), [
259 …assert.deepEqual(stooges, [['moe', 'larry', 'curly'], [30, 40, 50], ['stooge 1', 'stooge 2', 'stoo…
264 …assert.deepEqual(stooges, [['moe', 'larry', 'curly'], [30, 40, 50], [void 0, void 0, 'extra data']…
267 assert.deepEqual(empty, [], 'unzipped empty');
269 assert.deepEqual(_.zip(null), [], 'handles null');
270 assert.deepEqual(_.zip(), [], '_.zip() returns []');
274 assert.deepEqual(_.unzip(null), [], 'handles null');
276 assert.deepEqual(_.unzip([['a', 'b'], [1, 2]]), [['a', 1], ['b', 2]]);
280 assert.deepEqual(_.unzip(zipped), [['fred', 'barney'], [30, 40], [true, false]]);
283 …assert.deepEqual(_.unzip(zipped), [['moe', 30, void 0], ['larry', 40, void 0], ['curly', 50, 'extr…
289 assert.deepEqual(result, shouldBe, 'two arrays zipped together into an object');
293 assert.deepEqual(result, shouldBe, 'an array of pairs zipped together into an object');
296 …assert.deepEqual(_.object(_.pairs(stooges)), stooges, 'an object converted to pairs and back to an…
298 assert.deepEqual(_.object(null), {}, 'handles nulls');
417 …assert.deepEqual(actual, expected, 'should treat falsey `fromIndex` values, except `0` and `NaN`, …
424 assert.deepEqual(_.map([-6, -8, -Infinity], function(fromIndex) {
477 assert.deepEqual(obj, [{a: 1}]);
520 assert.deepEqual(obj, [{a: 1}]);
536 assert.deepEqual(_.range(0), [], 'range with 0 as a first argument generates an empty array');
537 …assert.deepEqual(_.range(4), [0, 1, 2, 3], 'range with a single positive argument generates an arr…
538 …assert.deepEqual(_.range(5, 8), [5, 6, 7], 'range with two arguments a &amp; b, a&lt;b generates a…
539 …assert.deepEqual(_.range(3, 10, 3), [3, 6, 9], 'range with three arguments a &amp; b &amp; c, c &l…
540 …assert.deepEqual(_.range(3, 10, 15), [3], 'range with three arguments a &amp; b &amp; c, c &gt; b-…
541 …assert.deepEqual(_.range(12, 7, -2), [12, 10, 8], 'range with three arguments a &amp; b &amp; c, a…
542 …assert.deepEqual(_.range(0, -10, -1), [0, -1, -2, -3, -4, -5, -6, -7, -8, -9], 'final example in t…
544 assert.deepEqual(_.range(8, 5), [8, 7, 6], 'negative range generates descending array');
545 assert.deepEqual(_.range(-3), [0, -1, -2], 'negative range generates descending array');
549 assert.deepEqual(_.chunk([], 2), [], 'chunk for empty array returns an empty array');
551 … assert.deepEqual(_.chunk([1, 2, 3], 0), [], 'chunk into parts of 0 elements returns empty array');
552 …assert.deepEqual(_.chunk([1, 2, 3], -1), [], 'chunk into parts of negative amount of elements retu…
553 assert.deepEqual(_.chunk([1, 2, 3]), [], 'defaults to empty array (chunk size 0)');
555 …assert.deepEqual(_.chunk([1, 2, 3], 1), [[1], [2], [3]], 'chunk into parts of 1 elements returns o…
557 …assert.deepEqual(_.chunk([1, 2, 3], 3), [[1, 2, 3]], 'chunk into parts of current array length ele…
558 …assert.deepEqual(_.chunk([1, 2, 3], 5), [[1, 2, 3]], 'chunk into parts of more then current array …
560 …assert.deepEqual(_.chunk([10, 20, 30, 40, 50, 60, 70], 2), [[10, 20], [30, 40], [50, 60], [70]], '…
561 …assert.deepEqual(_.chunk([10, 20, 30, 40, 50, 60, 70], 3), [[10, 20, 30], [40, 50, 60], [70]], 'ch…