Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-07-26 14:32:09 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-07-28 13:36:15 +0300
commit888b771803cd326ee29c560952a40a78b240e391 (patch)
tree5923e042ebdc3e116399fc96bd658f6fafb6a82a
parentd315fc6aad1eeb9709584661cb1a042d212be3d4 (diff)
helper: Drop test of internal unused function
One of the regression tests we have asserts that the current implementation of `ErrPreconditionFailedf()` matches what we had before it had been refactored. While this test was a nice demonstrator back when the interfaces were refactored, nowadays it doesn't serve much of a purpose: we know it behaves the same, so there's not much of a need to retain it now. Drop the testcase.
-rw-r--r--internal/helper/errors_test.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/internal/helper/errors_test.go b/internal/helper/errors_test.go
index 9ab545cff..dfecb990b 100644
--- a/internal/helper/errors_test.go
+++ b/internal/helper/errors_test.go
@@ -77,13 +77,6 @@ func TestErrorF_withWFormat(t *testing.T) {
testErrorfFormat(t, "expected %w", "expected %s")
}
-// oldPreconditionFailedf shows ErrPreconditionFailedf looked like
-// before 777a12cfd. We're testing the nature of a regression in that
-// change.
-func oldPreconditionFailedf(format string, a ...interface{}) error {
- return DecorateError(codes.FailedPrecondition, fmt.Errorf(format, a...))
-}
-
func testErrorfFormat(t *testing.T, errorFormat, errorFormatEqual string) {
isFormatW := strings.Contains(errorFormat, "%w")
errorMessage := "sentinel error"
@@ -112,11 +105,6 @@ func testErrorfFormat(t *testing.T, errorFormat, errorFormatEqual string) {
errorf: ErrPreconditionFailedf,
code: codes.FailedPrecondition,
},
- {
- desc: "oldPreconditionFailedf",
- errorf: oldPreconditionFailedf,
- code: codes.FailedPrecondition,
- },
} {
t.Run(tc.desc, func(t *testing.T) {
// tc.code and our canary test code must not