(c *gc.C)
| 65 | } |
| 66 | |
| 67 | func (*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 | |
| 79 | func (*functionSuite) TestDeferredAnnotatef(c *gc.C) { |
| 80 | // NOTE: this test fails with gccgo |