• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3const zlib = require('zlib');
4const assert = require('assert');
5
6const message = 'Come on, Fhqwhgads.';
7const buffer = Buffer.from(message);
8
9const zipper = new zlib.Gzip();
10zipper.on('close', common.mustNotCall());
11
12const zipped = zipper._processChunk(buffer, zlib.constants.Z_FINISH);
13
14const unzipper = new zlib.Gunzip();
15unzipper.on('close', common.mustNotCall());
16
17const unzipped = unzipper._processChunk(zipped, zlib.constants.Z_FINISH);
18assert.notStrictEqual(zipped.toString(), message);
19assert.strictEqual(unzipped.toString(), message);
20