MCPcopy
hub / github.com/golang/protobuf / TestUnmarshalAnyMixAndMatch

Function TestUnmarshalAnyMixAndMatch

proto/text_test.go:269–281  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

267}
268
269func TestUnmarshalAnyMixAndMatch(t *testing.T) {
270 pb := &anypb.Any{}
271 err := proto.UnmarshalText(`
272 value: "\n\x05Monty"
273 [type.googleapis.com/a/path/proto3_test.Nested]: <
274 bunny: "Rabbit of Caerbannog"
275 >
276 `, pb)
277 want := `line 5: Any message unpacked multiple times, or "value" already set`
278 if err.Error() != want {
279 t.Errorf("incorrect error:\ngot: %v\nwant: %v", err.Error(), want)
280 }
281}
282
283// textMessage implements the methods that allow it to marshal and unmarshal
284// itself as text.

Callers

nothing calls this directly

Calls 2

UnmarshalTextFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected