Added test for issue #29

master
Vitaly Puzrin 2014-07-03 21:44:39 +04:00
rodzic 0df06dbb67
commit 87a6a88255
1 zmienionych plików z 28 dodań i 0 usunięć

Wyświetl plik

@ -104,3 +104,31 @@ describe('Dummy push (force end)', function () {
});
});
describe('Edge condition', function () {
it.skip('should be ok on buffer border', function () {
var i;
var data = new Uint8Array(1024 * 16 + 1);
for (i = 0; i < data.length; i++) {
data[i] = Math.floor(Math.random() * 255.999);
}
var deflated = pako.deflate(data);
var inflator = new pako.Inflate();
for (i = 0; i < deflated.length; i++) {
inflator.push(deflated.subarray(i, i+1), false);
assert.ok(!inflator.err, 'Inflate failed with status ' + inflator.err);
}
inflator.push(new Uint8Array(0), true);
assert.ok(!inflator.err, 'Inflate failed with status ' + inflator.err);
assert(helpers.cmpBuf(data, inflator.result));
});
});