MCPcopy Index your code
hub / github.com/nodejs/node / testGzipActuallyCompresses

Function testGzipActuallyCompresses

test/parallel/test-stream-iter-transform-sync.js:51–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51function testGzipActuallyCompresses() {
52 const input = 'Repeated data compresses well. '.repeat(1000);
53 const inputBuf = Buffer.from(input);
54 const compressed = bytesSync(pullSync(fromSync(inputBuf),
55 compressGzipSync()));
56 assert.ok(compressed.byteLength < inputBuf.byteLength,
57 `Compressed ${compressed.byteLength} should be < ` +
58 `original ${inputBuf.byteLength}`);
59}
60
61function testGzipBinaryData() {
62 const inputBuf = Buffer.alloc(10000);

Calls 6

bytesSyncFunction · 0.85
pullSyncFunction · 0.85
compressGzipSyncFunction · 0.85
fromSyncFunction · 0.50
fromMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…