Sha256: d58923ff9e79b4787d05c88d39c19618b67193f5acde40a2d8926fed5e7ed5d9

Contents?: true

Size: 1.81 KB

Versions: 73

Compression:

Stored size: 1.81 KB

Contents

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var tape = require('tape');
var zlib = require('../');
var fs = require('fs');

tape('write after flush', function(t) {
  t.plan(2);
  
  var gzip = zlib.createGzip();
  var gunz = zlib.createUnzip();

  gzip.pipe(gunz);

  var output = '';
  var input = 'A line of data\n';
  gunz.setEncoding('utf8');
  gunz.on('data', function(c) {
    output += c;
  });
  
  gunz.on('end', function() {
    t.equal(output, input);
    
    // Make sure that the flush flag was set back to normal
    t.equal(gzip._flushFlag, zlib.Z_NO_FLUSH);
  });
  
  // make sure that flush/write doesn't trigger an assert failure
  gzip.flush(); write();
  function write() {
    gzip.write(input);
    gzip.end();
    gunz.read(0);
  }
});

Version data entries

73 entries across 73 versions & 5 rubygems

Version Path
smock-0.1.1 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.238 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.237 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.236 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.235 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.234 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.233 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.232 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.231 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.230 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.229 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.228 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.227 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.226 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.225 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.224 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.9 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.223 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.222 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js
smock-0.1.221 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js