mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Fix build test and add extra "Arrays" and "Functions" method category tests.
Former-commit-id: 924e034ec6ec8d05d573dff969f064f1bb32ea33
This commit is contained in:
@@ -214,7 +214,6 @@
|
|||||||
'merge',
|
'merge',
|
||||||
'omit',
|
'omit',
|
||||||
'pairs',
|
'pairs',
|
||||||
'parseInt',
|
|
||||||
'pick',
|
'pick',
|
||||||
'values'
|
'values'
|
||||||
];
|
];
|
||||||
@@ -225,6 +224,7 @@
|
|||||||
'identity',
|
'identity',
|
||||||
'mixin',
|
'mixin',
|
||||||
'noConflict',
|
'noConflict',
|
||||||
|
'parseInt',
|
||||||
'random',
|
'random',
|
||||||
'result',
|
'result',
|
||||||
'runInContext',
|
'runInContext',
|
||||||
|
|||||||
25
test/test.js
25
test/test.js
@@ -2944,15 +2944,32 @@
|
|||||||
oldDash = window._;
|
oldDash = window._;
|
||||||
|
|
||||||
var returnArrays = [
|
var returnArrays = [
|
||||||
|
'at',
|
||||||
|
'compact',
|
||||||
|
'difference',
|
||||||
'filter',
|
'filter',
|
||||||
|
'flatten',
|
||||||
|
'functions',
|
||||||
|
'initial',
|
||||||
|
'intersection',
|
||||||
'invoke',
|
'invoke',
|
||||||
|
'keys',
|
||||||
'map',
|
'map',
|
||||||
|
'pairs',
|
||||||
'pluck',
|
'pluck',
|
||||||
|
'range',
|
||||||
'reject',
|
'reject',
|
||||||
|
'rest',
|
||||||
'shuffle',
|
'shuffle',
|
||||||
'sortBy',
|
'sortBy',
|
||||||
|
'times',
|
||||||
'toArray',
|
'toArray',
|
||||||
'where'
|
'union',
|
||||||
|
'uniq',
|
||||||
|
'values',
|
||||||
|
'where',
|
||||||
|
'without',
|
||||||
|
'zip'
|
||||||
];
|
];
|
||||||
|
|
||||||
var funcs = _.without.apply(_, [_.functions(_)].concat([
|
var funcs = _.without.apply(_, [_.functions(_)].concat([
|
||||||
@@ -2970,6 +2987,7 @@
|
|||||||
'memoize',
|
'memoize',
|
||||||
'once',
|
'once',
|
||||||
'partial',
|
'partial',
|
||||||
|
'partialRight',
|
||||||
'tap',
|
'tap',
|
||||||
'throttle',
|
'throttle',
|
||||||
'wrap'
|
'wrap'
|
||||||
@@ -2977,10 +2995,13 @@
|
|||||||
|
|
||||||
_.each(funcs, function(methodName) {
|
_.each(funcs, function(methodName) {
|
||||||
var actual = [],
|
var actual = [],
|
||||||
expected = _.times(falsey.length, function() { return []; }),
|
|
||||||
func = _[methodName],
|
func = _[methodName],
|
||||||
pass = true;
|
pass = true;
|
||||||
|
|
||||||
|
var expected = (methodName == 'union')
|
||||||
|
? _.map(falsey, function(value, index) { return index ? [value] : []; })
|
||||||
|
: _.map(falsey, function() { return []; });
|
||||||
|
|
||||||
_.each(falsey, function(value, index) {
|
_.each(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
actual.push(index ? func(value) : func());
|
actual.push(index ? func(value) : func());
|
||||||
|
|||||||
Reference in New Issue
Block a user