mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 15:32:15 +00:00

Changes in test-zlib-from-string is because var->const pushed us over the max char limit per line. PR-URL: https://github.com/nodejs/node/pull/8627 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
19 lines
417 B
JavaScript
19 lines
417 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
const zlib = require('zlib');
|
|
const gz = zlib.Gzip();
|
|
const emptyBuffer = Buffer.alloc(0);
|
|
var received = 0;
|
|
gz.on('data', function(c) {
|
|
received += c.length;
|
|
});
|
|
|
|
gz.on('end', common.mustCall(function() {
|
|
assert.strictEqual(received, 20);
|
|
}));
|
|
gz.on('finish', common.mustCall(function() {}));
|
|
gz.write(emptyBuffer);
|
|
gz.end();
|