MCPcopy Create free account
hub / github.com/apache/dubbo-go / TestBinaryEncodingQuick

Function TestBinaryEncodingQuick

protocol/triple/triple_protocol/header_test.go:28–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

EncodeBinaryHeaderFunction · 0.85
DecodeBinaryHeaderFunction · 0.85
FatalfMethod · 0.65
CheckMethod · 0.65
ErrorMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected