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

Function testPullSyncSABChunks

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

Source from the content-addressed store, hash-verified

126// =============================================================================
127
128function testPullSyncSABChunks() {
129 function* gen() {
130 const sab = new SharedArrayBuffer(2);
131 new Uint8Array(sab).set([1, 2]);
132 yield [new Uint8Array(sab)];
133 }
134 const batches = [];
135 for (const batch of pullSync(gen())) {
136 batches.push(batch);
137 }
138 assert.strictEqual(batches.length, 1);
139 assert.deepStrictEqual(batches[0][0], new Uint8Array([1, 2]));
140}
141
142async function testPullAsyncSABChunks() {
143 async function* gen() {

Calls 3

pullSyncFunction · 0.85
genFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…