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

Function deflateRawResetDictionaryTest

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

Source from the content-addressed store, hash-verified

135}
136
137function deflateRawResetDictionaryTest(spdyDict) {
138 let doneReset = false;
139 let output = '';
140 const deflate = zlib.createDeflateRaw({ dictionary: spdyDict });
141 const inflate = zlib.createInflateRaw({ dictionary: spdyDict });
142 inflate.setEncoding('utf-8');
143
144 deflate.on('data', function(chunk) {
145 if (doneReset)
146 inflate.write(chunk);
147 });
148
149 inflate.on('data', function(chunk) {
150 output += chunk;
151 });
152
153 deflate.on('end', function() {
154 inflate.end();
155 });
156
157 inflate.on('end', common.mustCall(function() {
158 assert.strictEqual(input, output);
159 }));
160
161 deflate.write(input);
162 deflate.flush(function() {
163 deflate.reset();
164 doneReset = true;
165 deflate.write(input);
166 deflate.end();
167 });
168}
169
170for (const dict of [spdyDict, ...common.getBufferSources(spdyDict)]) {
171 basicDictionaryTest(dict);

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…