MCPcopy Create free account
hub / github.com/juju/errors / TestMaskf

Method TestMaskf

functions_test.go:153–162  ·  view source on GitHub ↗
(c *gc.C)

Source from the content-addressed store, hash-verified

151}
152
153func (*functionSuite) TestMaskf(c *gc.C) {
154 first := errors.New("first")
155 err := errors.Maskf(first, "masked %d", 42)
156 loc := errorLocationValue(c)
157 c.Assert(err.Error(), gc.Equals, "masked 42: first")
158 c.Assert(errors.Cause(err), gc.Equals, err)
159 c.Assert(errors.Details(err), Contains, loc)
160
161 c.Assert(errors.Maskf(nil, "mask"), gc.IsNil)
162}
163
164func (*functionSuite) TestCause(c *gc.C) {
165 c.Assert(errors.Cause(nil), gc.IsNil)

Callers

nothing calls this directly

Calls 6

NewFunction · 0.92
MaskfFunction · 0.92
CauseFunction · 0.92
DetailsFunction · 0.92
errorLocationValueFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected