Skip to content

Commit a8a5e19

Browse files
committed
fix test
1 parent 7e75cf4 commit a8a5e19

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/parallel/test-buffer-copy.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,14 @@ assert.deepStrictEqual(c, b.slice(0, c.length));
233233
const copied = buf.copy(x);
234234
assert.strictEqual(copied, 4);
235235
assert.ok(x instanceof Uint16Array);
236-
assert.deepStrictEqual(Array.from(x), [513, 1027, 0, 0]);
236+
const bytes = new Uint8Array(x.buffer, x.byteOffset, 4);
237+
assert.deepStrictEqual(Array.from(bytes), [1, 2, 3, 4]);
238+
const remaining = new Uint8Array(
239+
x.buffer,
240+
x.byteOffset + 4,
241+
x.byteLength - 4
242+
);
243+
assert.ok(remaining.every((b) => b === 0));
237244
}
238245

239246
{

0 commit comments

Comments
 (0)