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

Method TestTrace

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

Source from the content-addressed store, hash-verified

41}
42
43func (*functionSuite) TestTrace(c *gc.C) {
44 first := errors.New("first")
45 err := errors.Trace(first)
46 loc := errorLocationValue(c)
47
48 c.Assert(err.Error(), gc.Equals, "first")
49 c.Assert(errors.Is(err, first), gc.Equals, true)
50 c.Assert(errors.Details(err), Contains, loc)
51
52 c.Assert(errors.Trace(nil), gc.IsNil)
53}
54
55func (*functionSuite) TestAnnotate(c *gc.C) {
56 first := errors.New("first")

Callers

nothing calls this directly

Calls 6

NewFunction · 0.92
TraceFunction · 0.92
IsFunction · 0.92
DetailsFunction · 0.92
errorLocationValueFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected