MCPcopy Create free account
hub / github.com/cockroachdb/errors / TestRemoteErrorEquivalence

Function TestRemoteErrorEquivalence

markers/markers_test.go:89–100  ·  view source on GitHub ↗

This test demonstrates that the equivalence of errors is preserved over the network.

(t *testing.T)

Source from the content-addressed store, hash-verified

87// This test demonstrates that the equivalence
88// of errors is preserved over the network.
89func 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.

Callers

nothing calls this directly

Calls 3

CheckMethod · 0.95
IsFunction · 0.92
networkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…