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

Method TestIs

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

Source from the content-addressed store, hash-verified

361}
362
363func (*functionSuite) TestIs(c *gc.C) {
364 baseError := &basicError{"I'm an error"}
365 testErrors := []error{
366 errors.Trace(baseError),
367 errors.Annotate(baseError, "annotation"),
368 errors.Wrap(baseError, errors.New("wrapper")),
369 errors.Mask(baseError),
370 }
371
372 for _, err := range testErrors {
373 val := errors.Is(err, baseError)
374 c.Check(val, gc.Equals, true)
375 }
376}
377
378func (*functionSuite) TestSetLocationWithNilError(c *gc.C) {
379 c.Assert(errors.SetLocation(nil, 1), gc.IsNil)

Callers

nothing calls this directly

Calls 7

TraceFunction · 0.92
AnnotateFunction · 0.92
WrapFunction · 0.92
NewFunction · 0.92
MaskFunction · 0.92
IsFunction · 0.92
CheckMethod · 0.45

Tested by

no test coverage detected