Skip to content

Commit

Permalink
test: alter assert.strictEqual to default message
Browse files Browse the repository at this point in the history
PR-URL: #15978
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
gishmel authored and BridgeAR committed Oct 8, 2017
1 parent 037d908 commit 99237cf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/parallel/test-zlib-from-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ const expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN4' +
'sHnHNzRtagj5AQAA';

zlib.deflate(inputString, common.mustCall((err, buffer) => {
assert.strictEqual(buffer.toString('base64'), expectedBase64Deflate,
'deflate encoded string should match');
assert.strictEqual(buffer.toString('base64'), expectedBase64Deflate);
}));

zlib.gzip(inputString, common.mustCall((err, buffer) => {
Expand All @@ -67,19 +66,16 @@ zlib.gzip(inputString, common.mustCall((err, buffer) => {
// result that we're expecting, and this should match what we get
// from inflating the known valid deflate data.
zlib.gunzip(buffer, common.mustCall((err, gunzipped) => {
assert.strictEqual(gunzipped.toString(), inputString,
'Should get original string after gzip/gunzip');
assert.strictEqual(gunzipped.toString(), inputString);
}));
}));

let buffer = Buffer.from(expectedBase64Deflate, 'base64');
zlib.unzip(buffer, common.mustCall((err, buffer) => {
assert.strictEqual(buffer.toString(), inputString,
'decoded inflated string should match');
assert.strictEqual(buffer.toString(), inputString);
}));

buffer = Buffer.from(expectedBase64Gzip, 'base64');
zlib.unzip(buffer, common.mustCall((err, buffer) => {
assert.strictEqual(buffer.toString(), inputString,
'decoded gunzipped string should match');
assert.strictEqual(buffer.toString(), inputString);
}));

0 comments on commit 99237cf

Please sign in to comment.