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

Function TestMarshalUnknownAny

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

Source from the content-addressed store, hash-verified

222}
223
224func TestMarshalUnknownAny(t *testing.T) {
225 m := &pb3.Message{
226 Anything: &anypb.Any{
227 TypeUrl: "foo",
228 Value: []byte("bar"),
229 },
230 }
231 want := `anything: <
232 type_url: "foo"
233 value: "bar"
234>
235`
236 got := expandedMarshaler.Text(m)
237 if got != want {
238 t.Errorf("got:\n%s\nwant:\n%s", got, want)
239 }
240}
241
242func TestAmbiguousAny(t *testing.T) {
243 pb := &anypb.Any{}

Callers

nothing calls this directly

Calls 1

TextMethod · 0.80

Tested by

no test coverage detected