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

Function TestMarshalTextUnknownEnum

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

Source from the content-addressed store, hash-verified

432}
433
434func TestMarshalTextUnknownEnum(t *testing.T) {
435 // The Color enum only specifies values 0-2.
436 m := &pb2.MyMessage{Bikeshed: pb2.MyMessage_Color(3).Enum()}
437 got := m.String()
438 const want = `bikeshed:3 `
439 if got != want {
440 t.Errorf("\n got %q\nwant %q", got, want)
441 }
442}
443
444func TestTextOneof(t *testing.T) {
445 tests := []struct {

Callers

nothing calls this directly

Calls 2

StringMethod · 0.95
EnumMethod · 0.45

Tested by

no test coverage detected