MCPcopy Create free account
hub / github.com/juju/errors / TestWrap

Method TestWrap

functions_test.go:98–110  ·  view source on GitHub ↗
(c *gc.C)

Source from the content-addressed store, hash-verified

96}
97
98func (*functionSuite) TestWrap(c *gc.C) {
99 first := errors.New("first")
100 firstLoc := errorLocationValue(c)
101
102 detailed := errors.New("detailed")
103 err := errors.Wrap(first, detailed)
104 secondLoc := errorLocationValue(c)
105
106 c.Assert(err.Error(), gc.Equals, "detailed")
107 c.Assert(errors.Cause(err), gc.Equals, detailed)
108 c.Assert(errors.Details(err), Contains, firstLoc)
109 c.Assert(errors.Details(err), Contains, secondLoc)
110}
111
112func (*functionSuite) TestWrapOfNil(c *gc.C) {
113 detailed := errors.New("detailed")

Callers

nothing calls this directly

Calls 6

NewFunction · 0.92
WrapFunction · 0.92
CauseFunction · 0.92
DetailsFunction · 0.92
errorLocationValueFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected