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

Unified Diff: common/errors/errors_test.go

Issue 1249933002: Move multierror logic into luci-go. (Closed) Base URL: https://github.com/luci/luci-go@add_mathrand
Patch Set: Add New method to make importing common/errors a drop-in for the stdlib errors Created 5 years, 5 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
Index: common/errors/errors_test.go
diff --git a/common/errors/errors_test.go b/common/errors/errors_test.go
index e8657fd882dee348eedd2f497f733e32f39190fa..b3e8890fb614b73ea88f7226ffdff7f8b4cd9c1f 100644
--- a/common/errors/errors_test.go
+++ b/common/errors/errors_test.go
@@ -35,17 +35,17 @@ func TestMultiError(t *testing.T) {
Convey("MultiError works", t, func() {
var me error = MultiError{fmt.Errorf("hello"), fmt.Errorf("bob")}
- So(me.Error(), ShouldEqual, `["hello" "bob"]`)
+ So(me.Error(), ShouldEqual, `hello (and 1 other error)`)
Convey("MultiErrorFromErrors with errors works", func() {
mec := make(chan error, 5)
- mec <- fmt.Errorf("what")
- mec <- nil
mec <- MakeMarkFn("multiErr")("one-off")
+ mec <- nil
+ mec <- fmt.Errorf("what")
close(mec)
err := MultiErrorFromErrors(mec)
- So(err.Error(), ShouldEqual, `["what" "multiErr - errors_test.go:44 - one-off"]`)
+ So(err.Error(), ShouldEqual, `multiErr - errors_test.go:42 - one-off (and 1 other error)`)
})
Convey("MultiErrorFromErrors with nil works", func() {
@@ -97,6 +97,6 @@ func ExampleMultiError() {
fmt.Printf("got: %v\n", err)
// Output:
- // got: ["what"] len=1
+ // got: what len=1
// got: <nil>
}

Powered by Google App Engine
This is Rietveld 408576698