summaryrefslogtreecommitdiff
path: root/test/parallel/test-zlib-write-after-end.js
blob: 2b31ff30dc8591f520645988d0d7f16e83483757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';
const common = require('../common');
const zlib = require('zlib');

// Regression test for https://github.com/nodejs/node/issues/30976
// Writes to a stream should finish even after the readable side has been ended.

const data = zlib.deflateRawSync('Welcome');

const inflate = zlib.createInflateRaw();

inflate.resume();
inflate.write(data, common.mustCall());
inflate.write(Buffer.from([0x00]), common.mustCall());
inflate.write(Buffer.from([0x00]), common.mustCall());
inflate.flush(common.mustCall());