(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func (x) TestFileDescContainingExtension(t *testing.T) { |
| 125 | for _, test := range []struct { |
| 126 | st string |
| 127 | extNum int32 |
| 128 | want *descriptorpb.FileDescriptorProto |
| 129 | }{ |
| 130 | {"grpc.testing.ToBeExtended", 13, fdProto2Ext}, |
| 131 | {"grpc.testing.ToBeExtended", 17, fdProto2Ext}, |
| 132 | {"grpc.testing.ToBeExtended", 19, fdProto2Ext}, |
| 133 | {"grpc.testing.ToBeExtended", 23, fdProto2Ext2}, |
| 134 | {"grpc.testing.ToBeExtended", 29, fdProto2Ext2}, |
| 135 | } { |
| 136 | fd, err := s.FileDescEncodingContainingExtension(test.st, test.extNum, map[string]bool{}) |
| 137 | if err != nil { |
| 138 | t.Errorf("fileDescContainingExtension(%q) return error: %v", test.st, err) |
| 139 | continue |
| 140 | } |
| 141 | var actualFd descriptorpb.FileDescriptorProto |
| 142 | if err := proto.Unmarshal(fd[0], &actualFd); err != nil { |
| 143 | t.Errorf("fileDescContainingExtension(%q) return invalid bytes: %v", test.st, err) |
| 144 | continue |
| 145 | } |
| 146 | if !proto.Equal(&actualFd, test.want) { |
| 147 | t.Errorf("fileDescContainingExtension(%q) returned %q, but wanted %q", test.st, &actualFd, test.want) |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | // intArray is used to sort []int32 |
| 153 | type intArray []int32 |
nothing calls this directly
no test coverage detected