| 119 | } |
| 120 | |
| 121 | func (*functionSuite) TestWrapf(c *gc.C) { |
| 122 | first := errors.New("first") |
| 123 | firstLoc := errorLocationValue(c) |
| 124 | detailed := errors.New("detailed") |
| 125 | err := errors.Wrapf(first, detailed, "value %d", 42) |
| 126 | secondLoc := errorLocationValue(c) |
| 127 | c.Assert(err.Error(), gc.Equals, "value 42: detailed") |
| 128 | c.Assert(errors.Cause(err), gc.Equals, detailed) |
| 129 | c.Assert(errors.Details(err), Contains, firstLoc) |
| 130 | c.Assert(errors.Details(err), Contains, secondLoc) |
| 131 | } |
| 132 | |
| 133 | func (*functionSuite) TestWrapfOfNil(c *gc.C) { |
| 134 | detailed := errors.New("detailed") |