MCPcopy
hub / github.com/connectrpc/connect-go / TestBinaryEncodingQuick

Function TestBinaryEncodingQuick

header_test.go:26–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestBinaryEncodingQuick(t *testing.T) {
27 t.Parallel()
28 roundtrip := func(binary []byte) bool {
29 encoded := EncodeBinaryHeader(binary)
30 decoded, err := DecodeBinaryHeader(encoded)
31 if err != nil {
32 // We want to abort immediately. Don't use our assert package.
33 t.Fatalf("decode error: %v", err)
34 }
35 return bytes.Equal(decoded, binary)
36 }
37 if err := quick.Check(roundtrip, nil /* config */); err != nil {
38 t.Error(err)
39 }
40}
41
42func TestHeaderMerge(t *testing.T) {
43 t.Parallel()

Callers

nothing calls this directly

Calls 3

EncodeBinaryHeaderFunction · 0.85
DecodeBinaryHeaderFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected