MCPcopy
hub / github.com/gogo/protobuf / TestRepeatedEnum

Function TestRepeatedEnum

proto/text_parser_test.go:600–611  ·  view source on GitHub ↗

Regression test; this caused a panic.

(t *testing.T)

Source from the content-addressed store, hash-verified

598
599// Regression test; this caused a panic.
600func TestRepeatedEnum(t *testing.T) {
601 pb := new(RepeatedEnum)
602 if err := UnmarshalText("color: RED", pb); err != nil {
603 t.Fatal(err)
604 }
605 exp := &RepeatedEnum{
606 Color: []RepeatedEnum_Color{RepeatedEnum_RED},
607 }
608 if !Equal(pb, exp) {
609 t.Errorf("Incorrect populated \nHave: %v\nWant: %v", pb, exp)
610 }
611}
612
613func TestProto3TextParsing(t *testing.T) {
614 m := new(proto3pb.Message)

Callers

nothing calls this directly

Calls 2

UnmarshalTextFunction · 0.85
EqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…