()
| 196 | // ============================================================================= |
| 197 | |
| 198 | async function testUnlockAfterEnd() { |
| 199 | const filePath = path.join(tmpDir, 'writer-unlock.txt'); |
| 200 | const fh = await open(filePath, 'w'); |
| 201 | |
| 202 | const w1 = fh.writer(); |
| 203 | await w1.write(Buffer.from('first')); |
| 204 | await w1.end(); |
| 205 | |
| 206 | // Should work - handle is unlocked |
| 207 | const w2 = fh.writer(); |
| 208 | await w2.write(Buffer.from(' second')); |
| 209 | await w2.end(); |
| 210 | await fh.close(); |
| 211 | |
| 212 | assert.strictEqual(fs.readFileSync(filePath, 'utf8'), 'first second'); |
| 213 | } |
| 214 | |
| 215 | // ============================================================================= |
| 216 | // Unlock after fail - handle reusable |
no test coverage detected