Add _.restParam test for functions with more than 3 params.

This commit is contained in:
jdalton
2015-03-23 09:06:45 -07:00
parent 95f31be096
commit e7b4ada65f

View File

@@ -12569,6 +12569,14 @@
deepEqual(rp(1), [1, undefined, []]);
});
test('should work on functions with more than 3 params', 1, function() {
var rp = _.restParam(function(a, b, c, d) {
return slice.call(arguments);
});
deepEqual(rp(1, 2, 3, 4, 5), [1, 2, 3, [4, 5]]);
});
test('should not set a `this` binding', 1, function() {
var rp = _.restParam(function(x, y) {
return this[x] + this[y[0]];