Sha256: e2d668fbdc2d85e4d635bc0e07c9b72a23f3ce93065146c938714dc050b90cae

Contents?: true

Size: 1.05 KB

Versions: 62

Compression:

Stored size: 1.05 KB

Contents

/*global describe, it, pako, assert*/


'use strict';


var size = 100*1000;

var data_bin = (typeof Uint8Array !== 'undefined') ? new Uint8Array(size) : new Array(size);

for (var i=data_bin.length-1; i>=0; i--) { data_bin[i] = (Math.random(256)*256) & 0xff; }

var cmp = function (a, b) {
  if (a.length !== b.length) { return false; }
  for (var i=0, l=a.length; i<l; i++) { if (a[i] !== b[i]) { return false; } }
  return true;
};


describe('Generic', function () {

  it('defaults', function() {
    assert(cmp(data_bin, pako.inflate(pako.deflate(data_bin))));
  });


  describe('levels', function() {
    it('0', function() {
      assert(cmp(data_bin, pako.inflate(pako.deflate(data_bin, { level: 0 }))));
    });
    it('1', function() {
      assert(cmp(data_bin, pako.inflate(pako.deflate(data_bin, { level: 1 }))));
    });
    it('4', function() {
      assert(cmp(data_bin, pako.inflate(pako.deflate(data_bin, { level: 4 }))));
    });
    it('6', function() {
      assert(cmp(data_bin, pako.inflate(pako.deflate(data_bin, { level: 6 }))));
    });
  });
});

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
smock-0.1.246 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.245 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.244 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.243 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.242 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.241 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.240 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.239 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.2 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.1 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.238 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.237 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.236 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.235 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.234 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.233 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.232 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.231 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.230 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js
smock-0.1.229 node_modules/webpack/node_modules/node-libs-browser/node_modules/browserify-zlib/node_modules/pako/test/browser/test.js