Skip to content

Commit 6992259

Browse files
committed
test(NODE-1837): check for zstd magic number
1 parent f6e961f commit 6992259

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/unit/cmap/wire_protocol/compression.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ describe('compression', function () {
1313
it('compresses the data', function (done) {
1414
compress(options, buffer, (error, data) => {
1515
expect(error).to.not.exist;
16-
expect(data).to.not.deep.equal(buffer);
16+
const zstdMagicNumber = data.reverse().toString('hex').substring(16, 26);
17+
// Zstd magic number first set of bytes is is 0xFD2FB528
18+
expect(zstdMagicNumber).to.equal('00fd2fb528');
1719
done();
1820
});
1921
});
@@ -25,7 +27,9 @@ describe('compression', function () {
2527
it('compresses the data', function (done) {
2628
compress(options, buffer, (error, data) => {
2729
expect(error).to.not.exist;
28-
expect(data).to.not.deep.equal(buffer);
30+
const zstdMagicNumber = data.reverse().toString('hex').substring(16, 26);
31+
// Zstd magic number first set of bytes is is 0xFD2FB528
32+
expect(zstdMagicNumber).to.equal('00fd2fb528');
2933
done();
3034
});
3135
});

0 commit comments

Comments
 (0)