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

Method TestSetLocation

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

Source from the content-addressed store, hash-verified

380}
381
382func (*functionSuite) TestSetLocation(c *gc.C) {
383 err := errors.New("test")
384 err = errors.SetLocation(err, 1)
385 stack := fmt.Sprintf("%s: test", errorLocationValue(c))
386 _, implements := err.(errors.Locationer)
387 c.Assert(implements, gc.Equals, true)
388
389 c.Check(errors.ErrorStack(err), gc.Equals, stack)
390}
391
392func (*functionSuite) TestHideErrorStillReturnsErrorString(c *gc.C) {
393 err := stderrors.New("This is a simple error")

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
SetLocationFunction · 0.92
ErrorStackFunction · 0.92
errorLocationValueFunction · 0.85
CheckMethod · 0.45

Tested by

no test coverage detected