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

Unified Diff: common/errors/transient_test.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor Created 3 years, 6 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/transient_test.go
diff --git a/common/errors/transient_test.go b/common/errors/transient_test.go
deleted file mode 100644
index 0829c72a4e0365effe0f24c4ab978dd9db170b1c..0000000000000000000000000000000000000000
--- a/common/errors/transient_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015 The LUCI Authors. All rights reserved.
-// Use of this source code is governed under the Apache License, Version 2.0
-// that can be found in the LICENSE file.
-
-package errors
-
-import (
- "errors"
- "testing"
-
- . "github.com/smartystreets/goconvey/convey"
-)
-
-func TestTransientError(t *testing.T) {
- t.Parallel()
-
- Convey(`A nil error`, t, func() {
- err := error(nil)
-
- Convey(`Is not transient.`, func() {
- So(IsTransient(err), ShouldBeFalse)
- })
-
- Convey(`Returns nil when wrapped with a transient error.`, func() {
- So(WrapTransient(err), ShouldBeNil)
- })
- })
-
- Convey(`An error`, t, func() {
- err := errors.New("test error")
-
- Convey(`Is not transient.`, func() {
- So(IsTransient(err), ShouldBeFalse)
- })
- Convey(`When wrapped with a transient error`, func() {
- terr := WrapTransient(err)
- Convey(`Has the same error string.`, func() {
- So(terr.Error(), ShouldEqual, "test error")
- })
- Convey(`Is transient.`, func() {
- So(IsTransient(terr), ShouldBeTrue)
- })
- })
-
- Convey(`A MultiError with a transient sub-error is transient.`, func() {
- So(IsTransient(MultiError{nil, WrapTransient(err), err}), ShouldBeTrue)
- })
- })
-}

Powered by Google App Engine
This is Rietveld 408576698