(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func TestDecoder_SmallDict(t *testing.T) { |
| 15 | // All files have CRC |
| 16 | zr := testCreateZipReader("testdata/dict-tests-small.zip", t) |
| 17 | dicts := readDicts(t, zr) |
| 18 | dec, err := NewReader(nil, WithDecoderConcurrency(1), WithDecoderDicts(dicts...)) |
| 19 | if err != nil { |
| 20 | t.Fatal(err) |
| 21 | return |
| 22 | } |
| 23 | defer dec.Close() |
| 24 | for _, tt := range zr.File { |
| 25 | if !strings.HasSuffix(tt.Name, ".zst") { |
| 26 | continue |
| 27 | } |
| 28 | t.Run("decodeall-"+tt.Name, func(t *testing.T) { |
| 29 | r, err := tt.Open() |
| 30 | if err != nil { |
| 31 | t.Fatal(err) |
| 32 | } |
| 33 | defer r.Close() |
| 34 | in, err := io.ReadAll(r) |
| 35 | if err != nil { |
| 36 | t.Fatal(err) |
| 37 | } |
| 38 | got, err := dec.DecodeAll(in, nil) |
| 39 | if err != nil { |
| 40 | t.Fatal(err) |
| 41 | } |
| 42 | _, err = dec.DecodeAll(in, got[:0]) |
| 43 | if err != nil { |
| 44 | t.Fatal(err) |
| 45 | } |
| 46 | }) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func buildDictLevelPathFixture() (samples [][]byte, history, src []byte) { |
| 51 | history = bytes.Repeat([]byte("build dict common phrase alpha beta gamma delta "), 16) |
nothing calls this directly
no test coverage detected
searching dependent graphs…