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

Method TestNew

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

Source from the content-addressed store, hash-verified

23var _ = gc.Suite(&functionSuite{})
24
25func (*functionSuite) TestNew(c *gc.C) {
26 err := errors.New("testing")
27 loc := errorLocationValue(c)
28
29 c.Assert(err.Error(), gc.Equals, "testing")
30 c.Assert(errors.Cause(err), gc.Equals, err)
31 c.Assert(errors.Details(err), Contains, loc)
32}
33
34func (*functionSuite) TestErrorf(c *gc.C) {
35 err := errors.Errorf("testing %d", 42)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected