|
@ -55,8 +55,7 @@ const expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN4' + |
|
|
'sHnHNzRtagj5AQAA'; |
|
|
'sHnHNzRtagj5AQAA'; |
|
|
|
|
|
|
|
|
zlib.deflate(inputString, common.mustCall((err, buffer) => { |
|
|
zlib.deflate(inputString, common.mustCall((err, buffer) => { |
|
|
assert.strictEqual(buffer.toString('base64'), expectedBase64Deflate, |
|
|
assert.strictEqual(buffer.toString('base64'), expectedBase64Deflate); |
|
|
'deflate encoded string should match'); |
|
|
|
|
|
})); |
|
|
})); |
|
|
|
|
|
|
|
|
zlib.gzip(inputString, common.mustCall((err, buffer) => { |
|
|
zlib.gzip(inputString, common.mustCall((err, buffer) => { |
|
@ -67,19 +66,16 @@ zlib.gzip(inputString, common.mustCall((err, buffer) => { |
|
|
// result that we're expecting, and this should match what we get
|
|
|
// result that we're expecting, and this should match what we get
|
|
|
// from inflating the known valid deflate data.
|
|
|
// from inflating the known valid deflate data.
|
|
|
zlib.gunzip(buffer, common.mustCall((err, gunzipped) => { |
|
|
zlib.gunzip(buffer, common.mustCall((err, gunzipped) => { |
|
|
assert.strictEqual(gunzipped.toString(), inputString, |
|
|
assert.strictEqual(gunzipped.toString(), inputString); |
|
|
'Should get original string after gzip/gunzip'); |
|
|
|
|
|
})); |
|
|
})); |
|
|
})); |
|
|
})); |
|
|
|
|
|
|
|
|
let buffer = Buffer.from(expectedBase64Deflate, 'base64'); |
|
|
let buffer = Buffer.from(expectedBase64Deflate, 'base64'); |
|
|
zlib.unzip(buffer, common.mustCall((err, buffer) => { |
|
|
zlib.unzip(buffer, common.mustCall((err, buffer) => { |
|
|
assert.strictEqual(buffer.toString(), inputString, |
|
|
assert.strictEqual(buffer.toString(), inputString); |
|
|
'decoded inflated string should match'); |
|
|
|
|
|
})); |
|
|
})); |
|
|
|
|
|
|
|
|
buffer = Buffer.from(expectedBase64Gzip, 'base64'); |
|
|
buffer = Buffer.from(expectedBase64Gzip, 'base64'); |
|
|
zlib.unzip(buffer, common.mustCall((err, buffer) => { |
|
|
zlib.unzip(buffer, common.mustCall((err, buffer) => { |
|
|
assert.strictEqual(buffer.toString(), inputString, |
|
|
assert.strictEqual(buffer.toString(), inputString); |
|
|
'decoded gunzipped string should match'); |
|
|
|
|
|
})); |
|
|
})); |
|
|