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

Function TestEncodeRequiredFieldChecks

proto/encode_test.go:97–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestEncodeRequiredFieldChecks(t *testing.T) {
98 for _, test := range testValidMessages {
99 if !test.partial {
100 continue
101 }
102 for _, m := range test.decodeTo {
103 t.Run(fmt.Sprintf("%s (%T)", test.desc, m), func(t *testing.T) {
104 _, err := proto.Marshal(m)
105 if err == nil {
106 t.Fatalf("Marshal succeeded (want error)\nMessage:\n%v", prototext.Format(m))
107 }
108 })
109 }
110 }
111}
112
113func TestEncodeAppend(t *testing.T) {
114 want := []byte("prefix")

Callers

nothing calls this directly

Calls 3

MarshalFunction · 0.92
FormatFunction · 0.92
RunMethod · 0.80

Tested by

no test coverage detected