| Index: common/errors/multierror_test.go
|
| diff --git a/common/errors/multierror_test.go b/common/errors/multierror_test.go
|
| index 1bb7b0896297cbe60e4debc19964e552d28881b1..b8696315a62c52ea64aa046fe55010e21a11fc12 100644
|
| --- a/common/errors/multierror_test.go
|
| +++ b/common/errors/multierror_test.go
|
| @@ -6,6 +6,7 @@ package errors
|
|
|
| import (
|
| "errors"
|
| + "fmt"
|
| "testing"
|
|
|
| . "github.com/smartystreets/goconvey/convey"
|
| @@ -59,3 +60,23 @@ func TestUpstreamErrors(t *testing.T) {
|
| So(Fix(e), ShouldEqual, e)
|
| })
|
| }
|
| +
|
| +func TestAny(t *testing.T) {
|
| + t.Parallel()
|
| +
|
| + Convey(`Testing the Any function`, t, func() {
|
| + for _, tc := range []struct {
|
| + err error
|
| + has bool
|
| + }{
|
| + {nil, false},
|
| + {New("test error"), true},
|
| + {New("other error"), false},
|
| + {MultiError{MultiError{New("test error"), nil}, New("other error")}, true},
|
| + } {
|
| + Convey(fmt.Sprintf(`Registers %v for error [%v]`, tc.has, tc.err), func() {
|
| + So(Any(tc.err, func(err error) bool { return err.Error() == "test error" }), ShouldEqual, tc.has)
|
| + })
|
| + }
|
| + })
|
| +}
|
|
|