(c *gc.C)
| 154 | } |
| 155 | |
| 156 | func (*errorsSuite) TestNewErrWithCause(c *gc.C) { |
| 157 | if runtime.Compiler == "gccgo" { |
| 158 | c.Skip("gccgo can't determine the location") |
| 159 | } |
| 160 | causeErr := fmt.Errorf("external error") |
| 161 | err := errors.NewErrWithCause(causeErr, "testing %d", 43) |
| 162 | err.SetLocation(0) |
| 163 | locLine := errorLocationValue(c) |
| 164 | |
| 165 | c.Assert(err.Error(), gc.Equals, "testing 43: external error") |
| 166 | c.Assert(errors.Cause(&err), gc.Equals, causeErr) |
| 167 | c.Assert(errors.Details(&err), Contains, locLine) |
| 168 | } |
| 169 | |
| 170 | func (*errorsSuite) TestUnwrapNewErrGivesNil(c *gc.C) { |
| 171 | err := errors.New("test error") |
nothing calls this directly
no test coverage detected