Add deep clone test for buffers.

This commit is contained in:
John-David Dalton
2016-02-06 00:06:43 -08:00
parent 8810754ada
commit 984b0af883
2 changed files with 7 additions and 4 deletions

View File

@@ -2540,7 +2540,7 @@
});
QUnit.test('`_.' + methodName + '` should clone buffers', function(assert) {
assert.expect(3);
assert.expect(4);
if (Buffer) {
var buffer = new Buffer([1, 2]),
@@ -2549,9 +2549,12 @@
assert.strictEqual(actual.byteLength, buffer.byteLength);
assert.strictEqual(actual.inspect(), buffer.inspect());
assert.notStrictEqual(actual, buffer);
buffer[0] = 2;
assert.strictEqual(actual[0], isDeep ? 2 : 1);
}
else {
skipTest(assert, 3);
skipTest(assert, 4);
}
});