...
1
2
3
4
5 package impl_test
6
7 import (
8 "testing"
9
10 "google.golang.org/protobuf/reflect/protoreflect"
11
12 testpb "google.golang.org/protobuf/internal/testprotos/test"
13 )
14
15 func TestEnum(t *testing.T) {
16 et := testpb.ForeignEnum_FOREIGN_FOO.Type()
17 if got, want := et.New(protoreflect.EnumNumber(testpb.ForeignEnum_FOREIGN_FOO)), protoreflect.Enum(testpb.ForeignEnum_FOREIGN_FOO); got != want {
18 t.Errorf("testpb.ForeignEnum_FOREIGN_FOO.Type().New() = %[1]T(%[1]v), want %[2]T(%[2]v)", got, want)
19 }
20 }
21
View as plain text