()
| 97 | // ============================================================================= |
| 98 | |
| 99 | function testPipeToSyncSAB() { |
| 100 | const sab = new SharedArrayBuffer(3); |
| 101 | new Uint8Array(sab).set([65, 66, 67]); // 'ABC' |
| 102 | const written = []; |
| 103 | const writer = { |
| 104 | writeSync(chunk) { written.push(chunk); return true; }, |
| 105 | endSync() { return written.length; }, |
| 106 | }; |
| 107 | const totalBytes = pipeToSync(fromSync(sab), writer); |
| 108 | assert.strictEqual(totalBytes, 3); |
| 109 | assert.deepStrictEqual(written[0], new Uint8Array([65, 66, 67])); |
| 110 | } |
| 111 | |
| 112 | async function testPipeToAsyncSAB() { |
| 113 | const sab = new SharedArrayBuffer(3); |
no test coverage detected
searching dependent graphs…