Skip to content

Commit 4bfed26

Browse files
addaleaxMyles Borins
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 <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent bad006f commit 4bfed26

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
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)