()
| 31 | })); |
| 32 | |
| 33 | function writeToDecompress() { |
| 34 | // Write the compressed chunks to a decompressor, one by one, in order to |
| 35 | // verify that the flushes actually worked. |
| 36 | const chunk = compressedChunks.shift(); |
| 37 | if (chunk === undefined) return decompress.end(); |
| 38 | decompress.write(chunk, common.mustCall(() => { |
| 39 | events.push({ read: decompress.read(decompress.readableLength) }); |
| 40 | writeToDecompress(); |
| 41 | })); |
| 42 | } |
| 43 | |
| 44 | process.on('exit', () => { |
| 45 | assert.deepStrictEqual(events, [ |