mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 12:47:49 +00:00
Ensure _.xor returns an empty array when comparing the same array. [closes #2776]
This commit is contained in:
@@ -4414,7 +4414,7 @@
|
||||
|
||||
while (++othIndex < length) {
|
||||
var othArray = arrays[othIndex];
|
||||
if (othArray !== array) {
|
||||
if (othIndex != index) {
|
||||
result[index] = baseDifference(result[index] || array, othArray, iteratee, comparator);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25279,6 +25279,15 @@
|
||||
assert.deepEqual(actual, []);
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should return an empty array when comparing the same array', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var array = [1],
|
||||
actual = func(array, array, array);
|
||||
|
||||
assert.deepEqual(actual, []);
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should return an array of unique values', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user