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

Function TestSetDefaultsWithRepeatedSubMessage

proto/proto_test.go:1388–1401  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1386}
1387
1388func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) {
1389 got := &pb2.MyMessage{
1390 RepInner: []*pb2.InnerMessage{{}},
1391 }
1392 want := &pb2.MyMessage{
1393 RepInner: []*pb2.InnerMessage{{
1394 Port: proto.Int32(4000),
1395 }},
1396 }
1397 proto.SetDefaults(got)
1398 if !proto.Equal(got, want) {
1399 t.Errorf("\n got %v\nwant %v", got, want)
1400 }
1401}
1402
1403func TestSetDefaultWithRepeatedNonMessage(t *testing.T) {
1404 got := &pb2.MyMessage{

Callers

nothing calls this directly

Calls 3

Int32Function · 0.92
SetDefaultsFunction · 0.92
EqualFunction · 0.92

Tested by

no test coverage detected