This test demonstrates that the equivalence of errors is preserved over the network.
(t *testing.T)
| 87 | // This test demonstrates that the equivalence |
| 88 | // of errors is preserved over the network. |
| 89 | func TestRemoteErrorEquivalence(t *testing.T) { |
| 90 | tt := testutils.T{T: t} |
| 91 | |
| 92 | err1 := errors.New("hello") |
| 93 | err2 := errors.New("world") |
| 94 | |
| 95 | newErr1 := network(err1) |
| 96 | |
| 97 | tt.Check(markers.Is(err1, newErr1)) |
| 98 | tt.Check(markers.Is(newErr1, err1)) |
| 99 | tt.Check(!markers.Is(err2, newErr1)) |
| 100 | } |
| 101 | |
| 102 | // This test demonstrates that it is possible to recognize standard |
| 103 | // errors that have been sent over the network. |