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

Method TestErrorf

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

Source from the content-addressed store, hash-verified

32}
33
34func (*functionSuite) TestErrorf(c *gc.C) {
35 err := errors.Errorf("testing %d", 42)
36 loc := errorLocationValue(c)
37
38 c.Assert(err.Error(), gc.Equals, "testing 42")
39 c.Assert(errors.Cause(err), gc.Equals, err)
40 c.Assert(errors.Details(err), Contains, loc)
41}
42
43func (*functionSuite) TestTrace(c *gc.C) {
44 first := errors.New("first")

Callers

nothing calls this directly

Calls 5

ErrorfFunction · 0.92
CauseFunction · 0.92
DetailsFunction · 0.92
errorLocationValueFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected