Skip to content

Commit

Permalink
test: add zlib close-after-error regression test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
addaleax authored and Myles Borins committed Apr 20, 2016
1 parent bad006f commit 4bfed26
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/parallel/test-zlib-close-after-error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';
// https://github.com/nodejs/node/issues/6034

const common = require('../common');
const assert = require('assert');
const zlib = require('zlib');

const decompress = zlib.createGunzip(15);

decompress.on('error', common.mustCall((err) => {
assert.doesNotThrow(() => decompress.close());
}));

decompress.write('something invalid');

0 comments on commit 4bfed26

Please sign in to comment.