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

Function TestProto3TextParsing

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

Source from the content-addressed store, hash-verified

1303}
1304
1305func TestProto3TextParsing(t *testing.T) {
1306 m := new(pb3.Message)
1307 const in = `name: "Wallace" true_scotsman: true`
1308 want := &pb3.Message{
1309 Name: "Wallace",
1310 TrueScotsman: true,
1311 }
1312 if err := proto.UnmarshalText(in, m); err != nil {
1313 t.Fatal(err)
1314 }
1315 if !proto.Equal(m, want) {
1316 t.Errorf("proto.Equal mismatch:\ngot: %v\nwant %v", m, want)
1317 }
1318}
1319
1320func TestMapParsing(t *testing.T) {
1321 m := new(pb2.MessageWithMap)

Callers

nothing calls this directly

Calls 2

UnmarshalTextFunction · 0.92
EqualFunction · 0.92

Tested by

no test coverage detected