From afde4804c9d83440201da4ec3312d2af7e463da3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 9 Mar 2013 01:30:45 -0800 Subject: [PATCH] Fix build test and add extra "Arrays" and "Functions" method category tests. Former-commit-id: 924e034ec6ec8d05d573dff969f064f1bb32ea33 --- test/test-build.js | 2 +- test/test.js | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/test/test-build.js b/test/test-build.js index 6089c9b82..380cf71e0 100644 --- a/test/test-build.js +++ b/test/test-build.js @@ -214,7 +214,6 @@ 'merge', 'omit', 'pairs', - 'parseInt', 'pick', 'values' ]; @@ -225,6 +224,7 @@ 'identity', 'mixin', 'noConflict', + 'parseInt', 'random', 'result', 'runInContext', diff --git a/test/test.js b/test/test.js index d54256ee5..b2fbace05 100644 --- a/test/test.js +++ b/test/test.js @@ -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());