(t *testing.T)
| 2312 | } |
| 2313 | |
| 2314 | func TestDecoderDictDeleteMultiple(t *testing.T) { |
| 2315 | dictContent := []byte("test dictionary content") |
| 2316 | |
| 2317 | dec, err := NewReader(nil, |
| 2318 | WithDecoderDictRaw(100, dictContent), |
| 2319 | WithDecoderDictRaw(200, dictContent), |
| 2320 | WithDecoderDictRaw(300, dictContent)) |
| 2321 | if err != nil { |
| 2322 | t.Fatal(err) |
| 2323 | } |
| 2324 | defer dec.Close() |
| 2325 | |
| 2326 | if len(dec.o.dicts) != 3 { |
| 2327 | t.Fatalf("expected 3 dicts, got %d", len(dec.o.dicts)) |
| 2328 | } |
| 2329 | |
| 2330 | // Delete multiple dicts in one call |
| 2331 | err = dec.ResetWithOptions(nil, WithDecoderDictDelete(100, 300)) |
| 2332 | if err != nil { |
| 2333 | t.Fatal(err) |
| 2334 | } |
| 2335 | if len(dec.o.dicts) != 1 { |
| 2336 | t.Errorf("expected 1 dict after delete, got %d", len(dec.o.dicts)) |
| 2337 | } |
| 2338 | if _, ok := dec.o.dicts[200]; !ok { |
| 2339 | t.Error("dict 200 should still exist") |
| 2340 | } |
| 2341 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…