(c *gc.C)
| 77 | } |
| 78 | |
| 79 | func (*functionSuite) TestDeferredAnnotatef(c *gc.C) { |
| 80 | // NOTE: this test fails with gccgo |
| 81 | if runtime.Compiler == "gccgo" { |
| 82 | c.Skip("gccgo can't determine the location") |
| 83 | } |
| 84 | first := errors.New("first") |
| 85 | test := func() (err error) { |
| 86 | defer errors.DeferredAnnotatef(&err, "deferred %s", "annotate") |
| 87 | return first |
| 88 | } |
| 89 | err := test() |
| 90 | c.Assert(err.Error(), gc.Equals, "deferred annotate: first") |
| 91 | c.Assert(errors.Cause(err), gc.Equals, first) |
| 92 | |
| 93 | err = nil |
| 94 | errors.DeferredAnnotatef(&err, "deferred %s", "annotate") |
| 95 | c.Assert(err, gc.IsNil) |
| 96 | } |
| 97 | |
| 98 | func (*functionSuite) TestWrap(c *gc.C) { |
| 99 | first := errors.New("first") |
nothing calls this directly
no test coverage detected