mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Add _.isEqual test for buffers.
This commit is contained in:
@@ -3283,6 +3283,7 @@
|
||||
return false;
|
||||
}
|
||||
objIsArr = true;
|
||||
objIsObj = false;
|
||||
}
|
||||
if (isSameTag && !objIsObj) {
|
||||
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) {
|
||||
assert.expect(4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user