Lines Matching refs:deepEqual

13     assert.deepEqual(answers, [5, 10, 15], 'context object property accessed');
17 assert.deepEqual(answers, [1, 2, 3], 'can iterate a simple array');
23 …assert.deepEqual(answers, ['one', 'two', 'three'], 'iterating over objects works, and ignores the …
83 assert.deepEqual(_.toArray(trick), [length], 'toArray on obj with length: ' + length);
84 assert.deepEqual(_.shuffle(trick), [length], 'shuffle on obj with length: ' + length);
85 assert.deepEqual(_.sample(trick), length, 'sample on obj with length: ' + length);
146 assert.deepEqual(doubled, [2, 4, 6], 'doubled numbers');
149 assert.deepEqual(tripled, [3, 6, 9], 'tripled numbers with context');
152 assert.deepEqual(doubled, [2, 4, 6], 'OO-style doubled numbers');
157 assert.deepEqual(ids, ['1', '2'], 'Can use collection methods on Array-likes.');
159 assert.deepEqual(_.map(null, _.noop), [], 'handles a null properly');
161 assert.deepEqual(_.map([1], function() {
167 …assert.deepEqual(_.map(people, 'name'), ['moe', 'curly'], 'predicate string map to object properti…
236 assert.deepEqual(args, expected);
252 assert.deepEqual(args, expected);
269 assert.deepEqual(_.find(list, {a: 1}), {a: 1, b: 2}, 'can be used as findWhere');
270 assert.deepEqual(_.find(list, {b: 4}), {a: 1, b: 4});
284 assert.deepEqual(_.find(obj, {x: 2}), {x: 2, z: 2}, 'works on objects');
285 assert.deepEqual(_.find(obj, {x: 2, z: 1}), void 0);
286 assert.deepEqual(_.find(obj, function(x) {
292 assert.deepEqual(o, [{a: 1}]);
306 assert.deepEqual(_.filter(evenArray, isEven), [2, 4, 6]);
307 assert.deepEqual(_.filter(evenObject, isEven), [2], 'can filter objects');
308 …assert.deepEqual(_.filter([{}, evenObject, []], 'two'), [evenObject], 'predicate string map to obj…
316 assert.deepEqual(_.filter(list, {a: 1}), [{a: 1, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}]);
317 assert.deepEqual(_.filter(list, {b: 2}), [{a: 1, b: 2}, {a: 2, b: 2}]);
318 assert.deepEqual(_.filter(list, {}), list, 'Empty object accepts all items');
319 assert.deepEqual(_(list).filter({}), list, 'OO-filter');
328 assert.deepEqual(odds, [1, 3, 5], 'rejected each even number');
336 assert.deepEqual(evens, [2, 4, 6], 'rejected each odd number');
338 …assert.deepEqual(_.reject([odds, {one: 1, two: 2, three: 3}], 'two'), [odds], 'predicate string ma…
342 assert.deepEqual(_.reject(list, {a: 1}), [{a: 2, b: 2}]);
343 assert.deepEqual(_.reject(list, {b: 2}), [{a: 1, b: 3}, {a: 1, b: 4}]);
344 assert.deepEqual(_.reject(list, {}), [], 'Returns empty list given empty object');
345 assert.deepEqual(_.reject(list, []), [], 'Returns empty list given empty array');
456 assert.deepEqual(result[0], [1, 5, 7], 'first array sorted');
457 assert.deepEqual(result[1], [1, 2, 3], 'second array sorted');
461 assert.deepEqual(_.toArray(arguments), [1, 2, 3], 'called with arguments');
465 …assert.deepEqual(_.invoke([{a: null}, {}, {a: _.constant(1)}], 'a'), [null, void 0, 1], 'handles n…
475 assert.deepEqual(result[0], [1, 5, 7], 'first array sorted');
476 assert.deepEqual(result[1], [1, 2, 3], 'second array sorted');
478 assert.deepEqual(_.invoke([1, 2, 3], function(a) {
492 assert.deepEqual(result[0], [1, 5, 7], 'first array sorted');
493 assert.deepEqual(result[1], [1, 2, 3], 'second array sorted');
500 assert.deepEqual(_.pluck(people, 'name'), ['moe', 'curly'], 'pulls names out of objects');
501 …assert.deepEqual(_.pluck(people, 'address'), [void 0, void 0], 'missing properties are returned as…
503 assert.deepEqual(_.pluck([{'[object Object]': 1}], {}), [1]);
519 … assert.deepEqual(_.where([_, {a: 1, b: 2}, _], test), [_, _], 'checks properties given function');
525 assert.deepEqual(result, {a: 1, b: 2});
527 assert.deepEqual(result, {a: 1, b: 4});
544 …assert.deepEqual(_.findWhere([{y: 5, b: 6}, expect], new TestClass()), expect, 'uses class instanc…
578 …assert.deepEqual(_.map([[1, 2, 3], [4, 5, 6]], _.max), [3, 6], 'Finds correct max in array when ma…
585 …assert.deepEqual(_.max([{a: 1}, {a: 0, b: 3}, {a: 4}, {a: 2}], 'a'), {a: 4}, 'String keys use prop…
587 … assert.deepEqual(_.max([0, 2], function(c){ return c * this.x; }, {x: 1}), 2, 'Iterator context');
588 assert.deepEqual(_.max([[1], [2, 3], [-1, 4], [5]], 0), [5], 'Lookup falsy iterator');
589 assert.deepEqual(_.max([{0: 1}, {0: 2}, {0: -1}, {a: 1}], 0), {0: 2}, 'Lookup falsy iterator');
606 …assert.deepEqual(_.map([[1, 2, 3], [4, 5, 6]], _.min), [1, 4], 'Finds correct min in array when ma…
628 …assert.deepEqual(_.min([{a: 1}, {a: 0, b: 3}, {a: 4}, {a: 2}], 'a'), {a: 0, b: 3}, 'String keys us…
630 …assert.deepEqual(_.min([0, 2], function(c){ return c * this.x; }, {x: -1}), 2, 'Iterator context');
631 assert.deepEqual(_.min([[1], [2, 3], [-1, 4], [5]], 0), [-1, 4], 'Lookup falsy iterator');
632 assert.deepEqual(_.min([{0: 1}, {0: 2}, {0: -1}, {a: 1}], 0), {0: -1}, 'Lookup falsy iterator');
638 assert.deepEqual(_.pluck(people, 'name'), ['moe', 'curly'], 'stooges sorted by age');
641 …assert.deepEqual(_.sortBy(list, _.identity), [1, 2, 3, 4, void 0, void 0], 'sortBy with undefined …
645 assert.deepEqual(sorted, ['one', 'two', 'four', 'five', 'three'], 'sorted by length');
670 assert.deepEqual(actual, stableArray, 'sortBy should be stable for arrays');
671 assert.deepEqual(_.sortBy(stableArray, 'x'), stableArray, 'sortBy accepts property string');
677 assert.deepEqual(actual, stableArray, 'sortBy should be stable for objects');
680 …assert.deepEqual(_.sortBy(list), ['e', 'q', 'r', 't', 'w', 'y'], 'uses _.identity if iterator is n…
686 assert.deepEqual(parity[0], [2, 4, 6], 'put each even number in the right group');
690 assert.deepEqual(grouped['3'], ['one', 'two', 'six', 'ten']);
691 assert.deepEqual(grouped['4'], ['four', 'five', 'nine']);
692 assert.deepEqual(grouped['5'], ['three', 'seven', 'eight']);
716 assert.deepEqual(_.groupBy(matrix, 0), {1: [[1, 2], [1, 3]], 2: [[2, 3]]});
717 assert.deepEqual(_.groupBy(matrix, 1), {2: [[1, 2]], 3: [[1, 3], [2, 3]]});
768 assert.deepEqual(_.shuffle([1]), [1], 'behaves correctly on size 1 arrays');
773 …assert.deepEqual(numbers, _.sortBy(shuffled), 'contains the same members before and after shuffle'…
777 assert.deepEqual(shuffled.sort(), [1, 2, 3, 4], 'works on objects');
782 assert.deepEqual(_.sample([1, 2, 3], -2), [], 'behaves correctly on negative n');
785 assert.deepEqual(allSampled, numbers, 'contains the same members before and after sample');
787 assert.deepEqual(allSampled, numbers, 'also works when sampling more objects than are present');
792 …assert.deepEqual(_.sample([1, 2], -1), [], 'sampling a negative number of picks returns an empty a…
804 assert.deepEqual(_.toArray(a), [1, 2, 3], 'cloned array contains same elements');
807 assert.deepEqual(numbers, [1, 2, 3], 'object flattened into array');
812 assert.deepEqual(_.toArray(expected.join('')), expected, 'maintains astral characters');
813 assert.deepEqual(_.toArray(''), [], 'empty string into empty array');
821 assert.deepEqual(actual, _.map(document.childNodes, _.identity), 'works on NodeList');
845 …assert.deepEqual(_.partition(list, function(x) { return x < 4; }), [[0, 1, 2, 3], [4, 5]], 'handle…
846 …assert.deepEqual(_.partition(list, function(x) { return x & 1; }), [[1, 3, 5], [0, 2, 4]], 'handle…
847 …assert.deepEqual(_.partition(list, function(x) { return x - 3; }), [[0, 1, 2, 4, 5], [3]], 'handle…
848 …assert.deepEqual(_.partition(list, function(x) { return x > 1 ? null : true; }), [[0, 1], [2, 3, 4…
849 …assert.deepEqual(_.partition(list, function(x) { if (x < 2) return true; }), [[0, 1], [2, 3, 4, 5]…
850 …assert.deepEqual(_.partition({a: 1, b: 2, c: 3}, function(x) { return x > 1; }), [[2, 3], [1]], 'h…
852 …assert.deepEqual(_.partition(list, function(x, index) { return index % 2; }), [[1, 3, 5], [0, 2, 4…
853 …assert.deepEqual(_.partition(list, function(x, index, arr) { return x === arr.length - 1; }), [[5]…
856 … assert.deepEqual(_.partition([1, false, true, '']), [[1, true], [false, '']], 'Default iterator');
857 …assert.deepEqual(_.partition([{x: 1}, {x: 0}, {x: 1}], 'x'), [[{x: 1}, {x: 1}], [{x: 0}]], 'Takes …
861 …assert.deepEqual(_.partition([1, 2, 3], predicate, {x: 2}), [[2], [1, 3]], 'partition takes a cont…
863 …assert.deepEqual(_.partition([{a: 1}, {b: 2}, {a: 1, b: 2}], {a: 1}), [[{a: 1}, {a: 1, b: 2}], [{b…
882 assert.deepEqual(_.map(elementChildren, 'id'), ['id1', 'id2']);
883 assert.deepEqual(_.map(parent.childNodes, 'nodeType'), [1, 3, 1]);