Skip to content

Commit 3bacd19

Browse files
addaleaxMylesBorins
authored andcommitted
test: add zlib close-after-error regression test
Add a regression test based on the report in #6034. PR-URL: #6270 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4f6f599 commit 3bacd19

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
// https://github.com/nodejs/node/issues/6034
3+
4+
const common = require('../common');
5+
const assert = require('assert');
6+
const zlib = require('zlib');
7+
8+
const decompress = zlib.createGunzip(15);
9+
10+
decompress.on('error', common.mustCall((err) => {
11+
assert.doesNotThrow(() => decompress.close());
12+
}));
13+
14+
decompress.write('something invalid');

0 commit comments

Comments
 (0)