Fix build test and add extra "Arrays" and "Functions" method category tests.

Former-commit-id: 924e034ec6ec8d05d573dff969f064f1bb32ea33
This commit is contained in:
John-David Dalton
2013-03-09 01:30:45 -08:00
parent bc8ec9cd3e
commit afde4804c9
2 changed files with 24 additions and 3 deletions

View File

@@ -214,7 +214,6 @@
'merge',
'omit',
'pairs',
'parseInt',
'pick',
'values'
];
@@ -225,6 +224,7 @@
'identity',
'mixin',
'noConflict',
'parseInt',
'random',
'result',
'runInContext',

View File

@@ -2944,15 +2944,32 @@
oldDash = window._;
var returnArrays = [
'at',
'compact',
'difference',
'filter',
'flatten',
'functions',
'initial',
'intersection',
'invoke',
'keys',
'map',
'pairs',
'pluck',
'range',
'reject',
'rest',
'shuffle',
'sortBy',
'times',
'toArray',
'where'
'union',
'uniq',
'values',
'where',
'without',
'zip'
];
var funcs = _.without.apply(_, [_.functions(_)].concat([
@@ -2970,6 +2987,7 @@
'memoize',
'once',
'partial',
'partialRight',
'tap',
'throttle',
'wrap'
@@ -2977,10 +2995,13 @@
_.each(funcs, function(methodName) {
var actual = [],
expected = _.times(falsey.length, function() { return []; }),
func = _[methodName],
pass = true;
var expected = (methodName == 'union')
? _.map(falsey, function(value, index) { return index ? [value] : []; })
: _.map(falsey, function() { return []; });
_.each(falsey, function(value, index) {
try {
actual.push(index ? func(value) : func());