(t *testing.T)
| 193 | } |
| 194 | |
| 195 | func TestAdaptProtoErrorsWithWrapper(t *testing.T) { |
| 196 | // proto-native error types are preserved exactly |
| 197 | // together with their wrappers. |
| 198 | rErr := &errorspb.TestError{} |
| 199 | origErr := pkgErr.WithMessage(rErr, "hello roachpb") |
| 200 | t.Logf("start err: %# v", pretty.Formatter(origErr)) |
| 201 | |
| 202 | newErr := network(t, origErr) |
| 203 | |
| 204 | tt := testutils.T{T: t} |
| 205 | |
| 206 | // In any case, the library preserves the error message. |
| 207 | tt.CheckEqual(newErr.Error(), origErr.Error()) |
| 208 | |
| 209 | // Moreover, it preserves the entire structure. |
| 210 | tt.CheckDeepEqual(newErr, origErr) |
| 211 | } |
| 212 | |
| 213 | func TestAdaptContextCanceled(t *testing.T) { |
| 214 | // context.DeadlineExceeded is preserved exactly. |
nothing calls this directly
no test coverage detected
searching dependent graphs…