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 <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
gishmel authored and MylesBorins committed Oct 25, 2017
1 parent 291b9c5 commit 36747ee
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 @@ -34,8 +34,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 @@ -46,19 +45,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 36747ee

Please sign in to comment.