From 07fd0989ea04f8bd5da29d7619613cc7f47dd4af Mon Sep 17 00:00:00 2001 From: Graeme Yeates Date: Wed, 9 Jul 2014 10:28:31 -0400 Subject: [PATCH] Variadic curry test coverage --- test/test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test.js b/test/test.js index 4818ba752..cf734ab77 100644 --- a/test/test.js +++ b/test/test.js @@ -2130,6 +2130,13 @@ skipTest(4); } }); + + test('should pass any additional arguments after reaching arity target', 3, function() { + var curried = _.curry(fn, 2); + deepEqual(curried(1)(2, 3, 4), [1, 2, 3, 4]); + deepEqual(curried(1, 2, 3, 4), [1, 2, 3, 4]); + deepEqual(curried(1, 2, 3, 4, 5, 6), [1, 2, 3, 4, 5, 6]); + }); test('should return a function with a `length` of `0`', 6, function() { _.times(2, function(index) { @@ -2220,6 +2227,13 @@ } }); + test('should pass any additional arguments after reaching arity target', 3, function() { + var curried = _.curryRight(fn, 2); + deepEqual(curried(4)(1, 2, 3), [1, 2, 3, 4]); + deepEqual(curried(1, 2, 3, 4), [1, 2, 3, 4]); + deepEqual(curried(1, 2, 3, 4, 5, 6), [1, 2, 3, 4, 5, 6]); + }); + test('should return a function with a `length` of `0`', 6, function() { _.times(2, function(index) { var curried = index ? _.curryRight(fn, 4) : _.curryRight(fn);