()
| 60 | // ============================================================================= |
| 61 | |
| 62 | async function testMixedWriteAndWritev() { |
| 63 | const filePath = path.join(tmpDir, 'writer-mixed.txt'); |
| 64 | const fh = await open(filePath, 'w'); |
| 65 | const w = fh.writer(); |
| 66 | await w.write(Buffer.from('head-')); |
| 67 | await w.writev([Buffer.from('mid1-'), Buffer.from('mid2-')]); |
| 68 | await w.write(Buffer.from('tail')); |
| 69 | const totalBytes = await w.end(); |
| 70 | await fh.close(); |
| 71 | |
| 72 | assert.strictEqual(totalBytes, 19); |
| 73 | assert.strictEqual(fs.readFileSync(filePath, 'utf8'), 'head-mid1-mid2-tail'); |
| 74 | } |
| 75 | |
| 76 | // ============================================================================= |
| 77 | // end() returns totalBytesWritten |
no test coverage detected