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

Function TestAdaptGoSingleWrapErr

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

Source from the content-addressed store, hash-verified

56}
57
58func TestAdaptGoSingleWrapErr(t *testing.T) {
59 origErr := fmt.Errorf("an error %w", goErr.New("hello"))
60 t.Logf("start err: %# v", pretty.Formatter(origErr))
61
62 newErr := network(t, origErr)
63
64 tt := testutils.T{T: t}
65 // The library preserves the cause. It's not possible to preserve the fmt
66 // string.
67 tt.CheckEqual(newErr.Error(), origErr.Error())
68 tt.CheckContains(newErr.Error(), "hello")
69}
70
71func TestAdaptBaseGoJoinErr(t *testing.T) {
72 origErr := goErr.Join(goErr.New("hello"), goErr.New("world"))

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…