Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
zlib: Fix invalidly failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Nov 18, 2011
1 parent f004d5a commit 975f193
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/simple/test-zlib-from-string.js
Expand Up @@ -34,7 +34,16 @@ zlib.deflate(inputString, function(err, buffer) {
});

zlib.gzip(inputString, function(err, buffer) {
assert.equal(buffer.toString('base64'), expectedBase64Gzip, 'gzip encoded string should match');
// Can't actually guarantee that we'll get exactly the same
// deflated bytes when we compress a string, since the header
// depends on stuff other than the input string itself.
// However, decrypting it should definitely yield the same
// result that we're expecting, and this should match what we get
// from inflating the known valid deflate data.
zlib.gunzip(buffer, function (err, gunzipped) {
assert.equal(gunzipped.toString(), inputString,
'Should get original string after gzip/gunzip');
});
});

var buffer = new Buffer(expectedBase64Deflate, 'base64');
Expand Down

0 comments on commit 975f193

Please sign in to comment.