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

Method TestContextErr

internal/transport/transport_test.go:1825–1840  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1823}
1824
1825func (s) TestContextErr(t *testing.T) {
1826 for _, test := range []struct {
1827 // input
1828 errIn error
1829 // outputs
1830 errOut error
1831 }{
1832 {context.DeadlineExceeded, status.Error(codes.DeadlineExceeded, context.DeadlineExceeded.Error())},
1833 {context.Canceled, status.Error(codes.Canceled, context.Canceled.Error())},
1834 } {
1835 err := ContextErr(test.errIn)
1836 if err.Error() != test.errOut.Error() {
1837 t.Fatalf("ContextErr{%v} = %v \nwant %v", test.errIn, err, test.errOut)
1838 }
1839 }
1840}
1841
1842type windowSizeConfig struct {
1843 serverStream int32

Callers

nothing calls this directly

Calls 4

ErrorFunction · 0.92
ContextErrFunction · 0.85
ErrorMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected