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

Method TestFromNilProto

status/status_test.go:86–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func (s) TestFromNilProto(t *testing.T) {
87 tests := []*Status{nil, FromProto(nil)}
88 for _, s := range tests {
89 if c := s.Code(); c != codes.OK {
90 t.Errorf("s: %v - Expected s.Code() = OK; got %v", s, c)
91 }
92 if m := s.Message(); m != "" {
93 t.Errorf("s: %v - Expected s.Message() = \"\"; got %q", s, m)
94 }
95 if p := s.Proto(); p != nil {
96 t.Errorf("s: %v - Expected s.Proto() = nil; got %q", s, p)
97 }
98 if e := s.Err(); e != nil {
99 t.Errorf("s: %v - Expected s.Err() = nil; got %v", s, e)
100 }
101 }
102}
103
104func (s) TestError(t *testing.T) {
105 err := Error(codes.Internal, "test description")

Callers

nothing calls this directly

Calls 6

CodeMethod · 0.80
MessageMethod · 0.80
ProtoMethod · 0.80
ErrMethod · 0.80
FromProtoFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected