This test demonstrates that it is possible to recognize standard errors that have been sent over the network.
(t *testing.T)
| 117 | // This test demonstrates that it is possible to recognize standard |
| 118 | // errors that have been sent over the network. |
| 119 | func TestStandardFmtErrorRemoteEquivalence(t *testing.T) { |
| 120 | tt := testutils.T{T: t} |
| 121 | |
| 122 | err1 := fmt.Errorf("hello") |
| 123 | err2 := fmt.Errorf("world") |
| 124 | |
| 125 | newErr1 := network(err1) |
| 126 | |
| 127 | tt.Check(markers.Is(err1, newErr1)) |
| 128 | tt.Check(markers.Is(newErr1, err1)) |
| 129 | tt.Check(!markers.Is(err2, newErr1)) |
| 130 | tt.Check(!markers.Is(newErr1, err2)) |
| 131 | } |
| 132 | |
| 133 | // This test demonstrates that when the error library does not know |
| 134 | // how to encode an error, it still knows that it is different from |