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

Function TestAdaptGoMultiWrapErr

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

Source from the content-addressed store, hash-verified

81}
82
83func TestAdaptGoMultiWrapErr(t *testing.T) {
84 origErr := fmt.Errorf("an error %w and also %w", goErr.New("hello"), goErr.New("world"))
85 t.Logf("start err: %# v", pretty.Formatter(origErr))
86
87 newErr := network(t, origErr)
88
89 tt := testutils.T{T: t}
90 // The library preserves the causes. It's not possible to preserve the fmt string.
91 tt.CheckEqual(newErr.Error(), origErr.Error())
92 tt.CheckContains(newErr.Error(), "hello")
93 tt.CheckContains(newErr.Error(), "world")
94}
95
96func TestAdaptPkgWithMessage(t *testing.T) {
97 // Simple message wrappers from github.com/pkg/errors are preserved

Callers

nothing calls this directly

Calls 4

CheckEqualMethod · 0.95
CheckContainsMethod · 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…