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

Method TestAnnotatef

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

Source from the content-addressed store, hash-verified

65}
66
67func (*functionSuite) TestAnnotatef(c *gc.C) {
68 first := errors.New("first")
69 err := errors.Annotatef(first, "annotation %d", 2) //err annotatefTest
70 loc := errorLocationValue(c)
71
72 c.Assert(err.Error(), gc.Equals, "annotation 2: first")
73 c.Assert(errors.Cause(err), gc.Equals, first)
74 c.Assert(errors.Details(err), Contains, loc)
75
76 c.Assert(errors.Annotatef(nil, "annotate"), gc.IsNil)
77}
78
79func (*functionSuite) TestDeferredAnnotatef(c *gc.C) {
80 // NOTE: this test fails with gccgo

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected