mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Allow placeholders to persist through more than 1 curried call.
This commit is contained in:
20
test/test.js
20
test/test.js
@@ -3612,6 +3612,16 @@
|
||||
assert.deepEqual(curried(ph, ph, ph, 4)(ph, ph, 3)(ph, 2)(1), [1, 2, 3, 4]);
|
||||
});
|
||||
|
||||
QUnit.test('should persist placeholders', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var curried = _.curry(fn),
|
||||
ph = curried.placeholder,
|
||||
actual = curried(ph, ph, ph, 'd')('a')(ph)('b')('c');
|
||||
|
||||
assert.deepEqual(actual, ['a', 'b', 'c', 'd']);
|
||||
});
|
||||
|
||||
QUnit.test('should provide additional arguments after reaching the target arity', function(assert) {
|
||||
assert.expect(3);
|
||||
|
||||
@@ -3745,6 +3755,16 @@
|
||||
assert.deepEqual(curried(ph, ph, ph, 4)(ph, ph, 3)(ph, 2)(1), expected);
|
||||
});
|
||||
|
||||
QUnit.test('should persist placeholders', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var curried = _.curryRight(fn),
|
||||
ph = curried.placeholder,
|
||||
actual = curried('a', ph, ph, ph)('b')(ph)('c')('d');
|
||||
|
||||
assert.deepEqual(actual, ['a', 'b', 'c', 'd']);
|
||||
});
|
||||
|
||||
QUnit.test('should provide additional arguments after reaching the target arity', function(assert) {
|
||||
assert.expect(3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user