MCPcopy
hub / github.com/klauspost/compress / TestEncoderDictDelete

Function TestEncoderDictDelete

zstd/encoder_options_test.go:218–238  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

216}
217
218func TestEncoderDictDelete(t *testing.T) {
219 var buf bytes.Buffer
220 dictContent := []byte("test dictionary content for compression")
221 enc, err := NewWriter(&buf, WithEncoderDictRaw(123, dictContent))
222 if err != nil {
223 t.Fatal(err)
224 }
225 defer enc.Close()
226
227 if enc.o.dict == nil {
228 t.Fatal("dict should be set")
229 }
230
231 err = enc.ResetWithOptions(&buf, WithEncoderDictDelete())
232 if err != nil {
233 t.Fatal(err)
234 }
235 if enc.o.dict != nil {
236 t.Error("dict should be nil after delete")
237 }
238}

Callers

nothing calls this directly

Calls 7

CloseMethod · 0.95
WithEncoderDictRawFunction · 0.85
WithEncoderDictDeleteFunction · 0.85
FatalMethod · 0.80
NewWriterFunction · 0.70
ResetWithOptionsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…