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
nodejs#6034.

PR-URL: nodejs#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 joelostrowski committed Apr 25, 2016
1 parent 767d908 commit f5532a1
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 f5532a1

Please sign in to comment.