From f5532a17507ee9ba50e7f71c3244510154fc1dea Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 18 Apr 2016 05:43:37 +0200 Subject: [PATCH] test: add zlib close-after-error regression test Add a regression test based on the report in https://github.com/nodejs/node/issues/6034. PR-URL: https://github.com/nodejs/node/pull/6270 Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno Reviewed-By: James M Snell --- test/parallel/test-zlib-close-after-error.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/parallel/test-zlib-close-after-error.js diff --git a/test/parallel/test-zlib-close-after-error.js b/test/parallel/test-zlib-close-after-error.js new file mode 100644 index 00000000000000..2570ca266a6754 --- /dev/null +++ b/test/parallel/test-zlib-close-after-error.js @@ -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');