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

Method TestAnnotate

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

Source from the content-addressed store, hash-verified

53}
54
55func (*functionSuite) TestAnnotate(c *gc.C) {
56 first := errors.New("first")
57 err := errors.Annotate(first, "annotation")
58 loc := errorLocationValue(c)
59
60 c.Assert(err.Error(), gc.Equals, "annotation: first")
61 c.Assert(errors.Cause(err), gc.Equals, first)
62 c.Assert(errors.Details(err), Contains, loc)
63
64 c.Assert(errors.Annotate(nil, "annotate"), gc.IsNil)
65}
66
67func (*functionSuite) TestAnnotatef(c *gc.C) {
68 first := errors.New("first")

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected