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 11, 2017
1 parent e9d31bc commit 4a9e331
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 4a9e331

Please sign in to comment.