MCPcopy Index your code
hub / github.com/nodejs/node / testFromSyncSAB

Function testFromSyncSAB

test/parallel/test-stream-iter-sharedarraybuffer.js:25–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23// =============================================================================
24
25function testFromSyncSAB() {
26 const sab = new SharedArrayBuffer(4);
27 new Uint8Array(sab).set([10, 20, 30, 40]);
28 const batches = [];
29 for (const batch of fromSync(sab)) {
30 batches.push(batch);
31 }
32 assert.strictEqual(batches.length, 1);
33 assert.deepStrictEqual(batches[0][0], new Uint8Array([10, 20, 30, 40]));
34}
35
36async function testFromAsyncSAB() {
37 const sab = new SharedArrayBuffer(4);

Calls 3

fromSyncFunction · 0.50
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…