(t *testing.T)
| 1366 | } |
| 1367 | |
| 1368 | func TestSetDefaultsWithSubMessage(t *testing.T) { |
| 1369 | got := &pb2.OtherMessage{ |
| 1370 | Key: proto.Int64(123), |
| 1371 | Inner: &pb2.InnerMessage{ |
| 1372 | Host: proto.String("gopher"), |
| 1373 | }, |
| 1374 | } |
| 1375 | want := &pb2.OtherMessage{ |
| 1376 | Key: proto.Int64(123), |
| 1377 | Inner: &pb2.InnerMessage{ |
| 1378 | Host: proto.String("gopher"), |
| 1379 | Port: proto.Int32(4000), |
| 1380 | }, |
| 1381 | } |
| 1382 | proto.SetDefaults(got) |
| 1383 | if !proto.Equal(got, want) { |
| 1384 | t.Errorf("\n got %v\nwant %v", got, want) |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) { |
| 1389 | got := &pb2.MyMessage{ |
nothing calls this directly
no test coverage detected