(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestRegistry(t *testing.T) { |
| 18 | file := new(descpb.DescriptorProto).ProtoReflect().Descriptor().ParentFile() |
| 19 | path := file.Path() |
| 20 | pkg := file.Package() |
| 21 | if got := proto.FileDescriptor(path); len(got) == 0 { |
| 22 | t.Errorf("FileDescriptor(%q) = empty, want non-empty", path) |
| 23 | } |
| 24 | |
| 25 | name := protoreflect.FullName(pkg + ".FieldDescriptorProto_Label") |
| 26 | if got := proto.EnumValueMap(string(name)); len(got) == 0 { |
| 27 | t.Errorf("EnumValueMap(%q) = empty, want non-empty", name) |
| 28 | } |
| 29 | |
| 30 | msg := new(descpb.EnumDescriptorProto_EnumReservedRange) |
| 31 | name = msg.ProtoReflect().Descriptor().FullName() |
| 32 | wantType := reflect.TypeOf(msg) |
| 33 | gotType := proto.MessageType(string(name)) |
| 34 | if gotType != wantType { |
| 35 | t.Errorf("MessageType(%q) = %v, want %v", name, gotType, wantType) |
| 36 | } |
| 37 | } |
nothing calls this directly
no test coverage detected