mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
4d8674b50f
This does not fix occurrences in test/parallel/test-dns-* because those tests contain unrelated pre-existing bugs that would cause the tests to fail with this fix. This unrelated bug in those tests should be fixed separately before the use of mustNotCall() can be fixed in those files. PR-URL: https://github.com/nodejs/node/pull/44022 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
20 lines
595 B
JavaScript
20 lines
595 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const zlib = require('zlib');
|
|
const assert = require('assert');
|
|
|
|
const message = 'Come on, Fhqwhgads.';
|
|
const buffer = Buffer.from(message);
|
|
|
|
const zipper = new zlib.Gzip();
|
|
zipper.on('close', common.mustNotCall());
|
|
|
|
const zipped = zipper._processChunk(buffer, zlib.constants.Z_FINISH);
|
|
|
|
const unzipper = new zlib.Gunzip();
|
|
unzipper.on('close', common.mustNotCall());
|
|
|
|
const unzipped = unzipper._processChunk(zipped, zlib.constants.Z_FINISH);
|
|
assert.notStrictEqual(zipped.toString(), message);
|
|
assert.strictEqual(unzipped.toString(), message);
|