(t *testing.T)
| 408 | } |
| 409 | |
| 410 | func TestMarshalTextCustomMessage(t *testing.T) { |
| 411 | buf := new(bytes.Buffer) |
| 412 | if err := proto.MarshalText(buf, &textMessage{}); err != nil { |
| 413 | t.Fatalf("proto.MarshalText: %v", err) |
| 414 | } |
| 415 | got := buf.String() |
| 416 | if got != "custom" { |
| 417 | t.Errorf("got:\n%v\n\nwant:\n%v", got, "custom") |
| 418 | } |
| 419 | } |
| 420 | func TestMarshalTextNil(t *testing.T) { |
| 421 | want := "<nil>" |
| 422 | tests := []proto.Message{nil, (*pb2.MyMessage)(nil)} |
nothing calls this directly
no test coverage detected