Pārlūkot izejas kodu

TestResumableRequestHeaderTooMuchFailures: prepare for Go 1.14 changes

Go 1.14 adds quotes around the invalid scheme in the error returned in
golang/go@64cfe9f

Go 1.13:

    Get I%27m%20not%20an%20url: unsupported protocol scheme ""

Go 1.14:

    Get "I%27m%20not%20an%20url": unsupported protocol scheme ""

This patch updates the test to detect both versions of the error

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 gadi atpakaļ
vecāks
revīzija
6acfc42094
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      registry/resumable/resumablerequestreader_test.go

+ 3 - 2
registry/resumable/resumablerequestreader_test.go

@@ -75,9 +75,10 @@ func TestResumableRequestHeaderTooMuchFailures(t *testing.T) {
 	}
 	defer resreq.Close()
 
-	expectedError := `Get I%27m%20not%20an%20url: unsupported protocol scheme ""`
 	read, err := resreq.Read([]byte{})
-	assert.Check(t, is.Error(err, expectedError))
+	assert.Assert(t, err != nil)
+	assert.Check(t, is.ErrorContains(err, "unsupported protocol scheme"))
+	assert.Check(t, is.ErrorContains(err, "I%27m%20not%20an%20url"))
 	assert.Check(t, is.Equal(0, read))
 }