mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Cleanup _.curry.
Former-commit-id: edcc8b2b4c67fa04d8c67e7b7fcdd071c4155e89
This commit is contained in:
14
test/test.js
14
test/test.js
@@ -679,6 +679,20 @@
|
||||
equal(curried(1, 2, 3), 6);
|
||||
});
|
||||
|
||||
test('should work with partial methods', function() {
|
||||
function func(a, b, c) {
|
||||
return a + b + c;
|
||||
}
|
||||
|
||||
var curried = _.curry(func),
|
||||
a = _.partial(curried, 1),
|
||||
b = _.partialRight(a, 3),
|
||||
c = _.partialRight(a(2), 3);
|
||||
|
||||
equal(b(2), 6);
|
||||
equal(c(), 6);
|
||||
});
|
||||
|
||||
test('should not alter the `this` binding', function() {
|
||||
function func(a, b, c) {
|
||||
return this[a] + this[b] + this[c];
|
||||
|
||||
Reference in New Issue
Block a user