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

Function deflateResetDictionaryTest

test/parallel/test-zlib-dictionary.js:78–109  ·  view source on GitHub ↗
(spdyDict)

Source from the content-addressed store, hash-verified

76}
77
78function deflateResetDictionaryTest(spdyDict) {
79 let doneReset = false;
80 let output = '';
81 const deflate = zlib.createDeflate({ dictionary: spdyDict });
82 const inflate = zlib.createInflate({ dictionary: spdyDict });
83 inflate.setEncoding('utf-8');
84
85 deflate.on('data', function(chunk) {
86 if (doneReset)
87 inflate.write(chunk);
88 });
89
90 inflate.on('data', function(chunk) {
91 output += chunk;
92 });
93
94 deflate.on('end', function() {
95 inflate.end();
96 });
97
98 inflate.on('end', common.mustCall(function() {
99 assert.strictEqual(input, output);
100 }));
101
102 deflate.write(input);
103 deflate.flush(function() {
104 deflate.reset();
105 doneReset = true;
106 deflate.write(input);
107 deflate.end();
108 });
109}
110
111function rawDictionaryTest(spdyDict) {
112 let output = '';

Callers 1

Calls 6

flushMethod · 0.65
setEncodingMethod · 0.45
onMethod · 0.45
writeMethod · 0.45
endMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…