mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Add _.isEqual test for buffers.
This commit is contained in:
@@ -3283,6 +3283,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
objIsArr = true;
|
objIsArr = true;
|
||||||
|
objIsObj = false;
|
||||||
}
|
}
|
||||||
if (isSameTag && !objIsObj) {
|
if (isSameTag && !objIsObj) {
|
||||||
stack || (stack = new Stack);
|
stack || (stack = new Stack);
|
||||||
|
|||||||
15
test/test.js
15
test/test.js
@@ -9934,6 +9934,21 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test('should compare buffers', function(assert) {
|
||||||
|
assert.expect(3);
|
||||||
|
|
||||||
|
if (Buffer) {
|
||||||
|
var buffer = new Buffer([1]);
|
||||||
|
|
||||||
|
assert.strictEqual(_.isEqual(buffer, new Buffer([2])), false);
|
||||||
|
assert.strictEqual(_.isEqual(buffer, new Uint8Array([1])), false);
|
||||||
|
assert.strictEqual(_.isEqual(buffer, new Buffer([1])), true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipAssert(assert, 3);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test('should compare date objects', function(assert) {
|
QUnit.test('should compare date objects', function(assert) {
|
||||||
assert.expect(4);
|
assert.expect(4);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user