(t *testing.T)
| 418 | } |
| 419 | } |
| 420 | func TestMarshalTextNil(t *testing.T) { |
| 421 | want := "<nil>" |
| 422 | tests := []proto.Message{nil, (*pb2.MyMessage)(nil)} |
| 423 | for i, test := range tests { |
| 424 | buf := new(bytes.Buffer) |
| 425 | if err := proto.MarshalText(buf, test); err != nil { |
| 426 | t.Fatal(err) |
| 427 | } |
| 428 | if got := buf.String(); got != want { |
| 429 | t.Errorf("%d: got %q want %q", i, got, want) |
| 430 | } |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | func TestMarshalTextUnknownEnum(t *testing.T) { |
| 435 | // The Color enum only specifies values 0-2. |
nothing calls this directly
no test coverage detected