MCPcopy
hub / github.com/protocolbuffers/protobuf-go / TestSelfMarshalerWithDescriptor

Function TestSelfMarshalerWithDescriptor

proto/methods_test.go:126–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

124}
125
126func TestSelfMarshalerWithDescriptor(t *testing.T) {
127 m := &descSelfMarshaler{}
128 got, err := proto.Marshal(impl.Export{}.MessageOf(m).Interface())
129 want := []byte(descSelfMarshalerBytes)
130 if err != nil || !bytes.Equal(got, want) {
131 t.Fatalf("proto.Marshal(%v) = %v, %v; want %v, nil", m, got, err, want)
132 }
133}
134
135func TestDecodeFastCheckInitialized(t *testing.T) {
136 for _, test := range testValidMessages {

Callers

nothing calls this directly

Calls 4

MarshalFunction · 0.92
InterfaceMethod · 0.65
MessageOfMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected