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

Method TestFromToProto

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

Source from the content-addressed store, hash-verified

71}
72
73func (s) TestFromToProto(t *testing.T) {
74 s := &spb.Status{
75 Code: int32(codes.Internal),
76 Message: "test test test",
77 Details: []*anypb.Any{{TypeUrl: "foo", Value: []byte{3, 2, 1}}},
78 }
79
80 err := FromProto(s)
81 if got := err.Proto(); !proto.Equal(s, got) {
82 t.Fatalf("Expected errors to be identical - s: %v got: %v", s, got)
83 }
84}
85
86func (s) TestFromNilProto(t *testing.T) {
87 tests := []*Status{nil, FromProto(nil)}

Callers

nothing calls this directly

Calls 4

ProtoMethod · 0.80
FromProtoFunction · 0.70
EqualMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected