xref: /third_party/node/test/parallel/test-zlib-sync-no-event.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst zlib = require('zlib');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst message = 'Come on, Fhqwhgads.';
71cb0ef41Sopenharmony_ciconst buffer = Buffer.from(message);
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst zipper = new zlib.Gzip();
101cb0ef41Sopenharmony_cizipper.on('close', common.mustNotCall());
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ciconst zipped = zipper._processChunk(buffer, zlib.constants.Z_FINISH);
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ciconst unzipper = new zlib.Gunzip();
151cb0ef41Sopenharmony_ciunzipper.on('close', common.mustNotCall());
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciconst unzipped = unzipper._processChunk(zipped, zlib.constants.Z_FINISH);
181cb0ef41Sopenharmony_ciassert.notStrictEqual(zipped.toString(), message);
191cb0ef41Sopenharmony_ciassert.strictEqual(unzipped.toString(), message);
20

Indexes created Thu Nov 07 10:32:03 CST 2024