MCPcopy
hub / github.com/grpc/grpc-go / testFileContainingSymbolError

Function testFileContainingSymbolError

reflection/test/serverreflection_test.go:606–632  ·  view source on GitHub ↗
(t *testing.T, stream v1reflectiongrpc.ServerReflection_ServerReflectionInfoClient)

Source from the content-addressed store, hash-verified

604}
605
606func testFileContainingSymbolError(t *testing.T, stream v1reflectiongrpc.ServerReflection_ServerReflectionInfoClient) {
607 for _, test := range []string{
608 "grpc.testing.SearchService_",
609 "grpc.testing.SearchService.SearchE",
610 "grpc.testing_.SearchResponse",
611 "gpc.testing.ToBeExtended",
612 } {
613 if err := stream.Send(&v1reflectionpb.ServerReflectionRequest{
614 MessageRequest: &v1reflectionpb.ServerReflectionRequest_FileContainingSymbol{
615 FileContainingSymbol: test,
616 },
617 }); err != nil {
618 t.Fatalf("failed to send request: %v", err)
619 }
620 r, err := stream.Recv()
621 if err != nil {
622 // io.EOF is not ok.
623 t.Fatalf("failed to recv response: %v", err)
624 }
625
626 switch r.MessageResponse.(type) {
627 case *v1reflectionpb.ServerReflectionResponse_ErrorResponse:
628 default:
629 t.Errorf("FileContainingSymbol(%v) = %v, want type <ServerReflectionResponse_ErrorResponse>", test, r.MessageResponse)
630 }
631 }
632}
633
634func testFileContainingExtension(t *testing.T, stream v1reflectiongrpc.ServerReflection_ServerReflectionInfoClient) {
635 for _, test := range []struct {

Callers 1

TestReflectionEnd2endMethod · 0.85

Calls 4

SendMethod · 0.65
FatalfMethod · 0.65
RecvMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected