MCPcopy
hub / github.com/segmentio/kafka-go / TestCompression

Function TestCompression

compress/compress_test.go:44–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestCompression(t *testing.T) {
45 msg := kafka.Message{
46 Value: []byte("message"),
47 }
48
49 testEncodeDecode(t, msg, new(gzip.Codec))
50 testEncodeDecode(t, msg, new(snappy.Codec))
51 testEncodeDecode(t, msg, new(lz4.Codec))
52 if ktesting.KafkaIsAtLeast("2.1.0") {
53 testEncodeDecode(t, msg, new(zstd.Codec))
54 }
55}
56
57func compress(codec pkg.Codec, src []byte) ([]byte, error) {
58 b := new(bytes.Buffer)

Callers

nothing calls this directly

Calls 1

testEncodeDecodeFunction · 0.85

Tested by

no test coverage detected