(t *testing.T, desc protoreflect.EnumDescriptor, has func(int32) bool)
| 52 | } |
| 53 | |
| 54 | func assertMimeCoverage(t *testing.T, desc protoreflect.EnumDescriptor, has func(int32) bool) { |
| 55 | t.Helper() |
| 56 | var missing []string |
| 57 | values := desc.Values() |
| 58 | for i := 0; i < values.Len(); i++ { |
| 59 | v := values.Get(i) |
| 60 | if int32(v.Number()) == 0 { |
| 61 | continue // UNSPECIFIED; intentionally not mapped |
| 62 | } |
| 63 | if !has(int32(v.Number())) { |
| 64 | missing = append(missing, string(v.Name())) |
| 65 | } |
| 66 | } |
| 67 | if len(missing) > 0 { |
| 68 | t.Errorf("mime_map missing wire-string entries for: %v (add the wire MIME string to the corresponding forward map in mime_map.go)", missing) |
| 69 | } |
| 70 | } |
no test coverage detected