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>
This commit is contained in:
Sebastiaan van Stijn 2020-02-07 11:56:20 +01:00
parent adf066416f
commit 6acfc42094
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -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))
}