diff --git a/test/parallel/test-zlib-from-concatenated-gzip.js b/test/parallel/test-zlib-from-concatenated-gzip.js index 7f3942035a7e04..8f41a673fe450b 100644 --- a/test/parallel/test-zlib-from-concatenated-gzip.js +++ b/test/parallel/test-zlib-from-concatenated-gzip.js @@ -7,26 +7,27 @@ const zlib = require('zlib'); const fs = require('fs'); const fixtures = require('../common/fixtures'); -const abcEncoded = zlib.gzipSync('abc'); -const defEncoded = zlib.gzipSync('def'); +const abc = 'abc'; +const def = 'def'; + +const abcEncoded = zlib.gzipSync(abc); +const defEncoded = zlib.gzipSync(def); const data = Buffer.concat([ abcEncoded, defEncoded ]); -assert.strictEqual(zlib.gunzipSync(data).toString(), 'abcdef'); +assert.strictEqual(zlib.gunzipSync(data).toString(), (abc + def)); zlib.gunzip(data, common.mustCall((err, result) => { assert.ifError(err); - assert.strictEqual(result.toString(), 'abcdef', - 'result should match original string'); + assert.strictEqual(result.toString(), (abc + def)); })); zlib.unzip(data, common.mustCall((err, result) => { assert.ifError(err); - assert.strictEqual(result.toString(), 'abcdef', - 'result should match original string'); + assert.strictEqual(result.toString(), (abc + def)); })); // Multi-member support does not apply to zlib inflate/deflate. @@ -35,8 +36,8 @@ zlib.unzip(Buffer.concat([ zlib.deflateSync('def') ]), common.mustCall((err, result) => { assert.ifError(err); - assert.strictEqual(result.toString(), 'abc', - 'result should match contents of first "member"'); + assert.strictEqual(result.toString(), abc, + `First "member": ${result.toString()} === ${abc}`); })); // files that have the "right" magic bytes for starting a new gzip member