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

Function TestStandardFmtErrorRemoteEquivalence

markers/markers_test.go:119–131  ·  view source on GitHub ↗

This test demonstrates that it is possible to recognize standard errors that have been sent over the network.

(t *testing.T)

Source from the content-addressed store, hash-verified

117// This test demonstrates that it is possible to recognize standard
118// errors that have been sent over the network.
119func 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

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…