Add _.isEqual test for buffers.

This commit is contained in:
John-David Dalton
2016-10-02 13:37:47 -07:00
parent ffde99b216
commit 9985e81808
2 changed files with 16 additions and 0 deletions

View File

@@ -3283,6 +3283,7 @@
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);

View File

@@ -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);