forked from quic-go/quic-go
use assert.AnError consistently in tests (#5066)
No functional change expected.
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/quic-go/quic-go/http3"
|
||||
quicproxy "github.com/quic-go/quic-go/integrationtests/tools/proxy"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -396,14 +397,13 @@ func TestHTTPReestablishConnectionAfterDialError(t *testing.T) {
|
||||
port := startHTTPServer(t, mux)
|
||||
|
||||
var dialCounter int
|
||||
testErr := errors.New("test error")
|
||||
cl := http.Client{
|
||||
Transport: &http3.Transport{
|
||||
TLSClientConfig: getTLSClientConfig(),
|
||||
Dial: func(ctx context.Context, addr string, tlsConf *tls.Config, conf *quic.Config) (quic.EarlyConnection, error) {
|
||||
dialCounter++
|
||||
if dialCounter == 1 { // make the first dial fail
|
||||
return nil, testErr
|
||||
return nil, assert.AnError
|
||||
}
|
||||
return quic.DialAddrEarly(ctx, addr, tlsConf, conf)
|
||||
},
|
||||
@@ -412,7 +412,7 @@ func TestHTTPReestablishConnectionAfterDialError(t *testing.T) {
|
||||
defer cl.Transport.(io.Closer).Close()
|
||||
|
||||
_, err := cl.Get(fmt.Sprintf("https://localhost:%d/hello", port))
|
||||
require.ErrorIs(t, err, testErr)
|
||||
require.ErrorIs(t, err, assert.AnError)
|
||||
resp, err := cl.Get(fmt.Sprintf("https://localhost:%d/hello", port))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
|
||||
Reference in New Issue
Block a user