MCPcopy
hub / github.com/grafana/dskit / TestCompressionConfig_Validate

Function TestCompressionConfig_Validate

cache/compression_test.go:15–41  ·  cache/compression_test.go::TestCompressionConfig_Validate
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestCompressionConfig_Validate(t *testing.T) {
16 tests := map[string]struct {
17 cfg CompressionConfig
18 expected error
19 }{
20 "should pass with default config": {
21 cfg: CompressionConfig{},
22 },
23 "should pass with snappy compression": {
24 cfg: CompressionConfig{
25 Compression: "snappy",
26 },
27 },
28 "should fail with unsupported compression": {
29 cfg: CompressionConfig{
30 Compression: "unsupported",
31 },
32 expected: errUnsupportedCompression,
33 },
34 }
35
36 for testName, testData := range tests {
37 t.Run(testName, func(t *testing.T) {
38 assert.Equal(t, testData.expected, testData.cfg.Validate())
39 })
40 }
41}
42
43func TestSnappyCache(t *testing.T) {
44 ctx := context.Background()

Callers

nothing calls this directly

Calls 3

RunMethod · 0.80
EqualMethod · 0.45
ValidateMethod · 0.45

Tested by

no test coverage detected