Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: common/errors/multierror_test.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Fix proto comment. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/errors/multierror.go ('k') | common/gcloud/gs/gs.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
+ })
+ }
+ })
+}
« no previous file with comments | « common/errors/multierror.go ('k') | common/gcloud/gs/gs.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698