MCPcopy Index your code
hub / github.com/cockroachdb/errors / TestAdaptPkgWithMessage

Function TestAdaptPkgWithMessage

errbase/adapters_test.go:96–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestAdaptPkgWithMessage(t *testing.T) {
97 // Simple message wrappers from github.com/pkg/errors are preserved
98 // completely.
99 origErr := pkgErr.WithMessage(goErr.New("world"), "hello")
100 t.Logf("start err: %# v", pretty.Formatter(origErr))
101
102 newErr := network(t, origErr)
103
104 tt := testutils.T{T: t}
105 // The library preserves the error message.
106 tt.CheckEqual(newErr.Error(), origErr.Error())
107
108 // It actually preserves the full structure of the message,
109 // including its Go type.
110 tt.CheckDeepEqual(newErr, origErr)
111}
112
113func TestAdaptPkgFundamental(t *testing.T) {
114 // The "simple error" from github.com/pkg/errors is not

Callers

nothing calls this directly

Calls 4

CheckEqualMethod · 0.95
CheckDeepEqualMethod · 0.95
networkFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…