| 96 | } |
| 97 | |
| 98 | func (*functionSuite) TestWrap(c *gc.C) { |
| 99 | first := errors.New("first") |
| 100 | firstLoc := errorLocationValue(c) |
| 101 | |
| 102 | detailed := errors.New("detailed") |
| 103 | err := errors.Wrap(first, detailed) |
| 104 | secondLoc := errorLocationValue(c) |
| 105 | |
| 106 | c.Assert(err.Error(), gc.Equals, "detailed") |
| 107 | c.Assert(errors.Cause(err), gc.Equals, detailed) |
| 108 | c.Assert(errors.Details(err), Contains, firstLoc) |
| 109 | c.Assert(errors.Details(err), Contains, secondLoc) |
| 110 | } |
| 111 | |
| 112 | func (*functionSuite) TestWrapOfNil(c *gc.C) { |
| 113 | detailed := errors.New("detailed") |