forked from quic-go/quic-go
fix incorrect usage of errors.Is
errors.Is is supposed to used for equality of errors, not for type assertions. That's what errors.As is there for.
This commit is contained in:
@@ -371,7 +371,8 @@ var _ = Describe("MITM test", func() {
|
||||
}
|
||||
err := runTest(delayCb)
|
||||
Expect(err).To(HaveOccurred())
|
||||
Expect(err).To(MatchError(&quic.VersionNegotiationError{}))
|
||||
vnErr := &quic.VersionNegotiationError{}
|
||||
Expect(errors.As(err, &vnErr)).To(BeTrue())
|
||||
})
|
||||
|
||||
// times out, because client doesn't accept subsequent real retry packets from server
|
||||
|
||||
@@ -2,6 +2,7 @@ package self_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
@@ -99,7 +100,8 @@ var _ = Describe("Stateless Resets", func() {
|
||||
_, serr = str.Read([]byte{0})
|
||||
}
|
||||
Expect(serr).To(HaveOccurred())
|
||||
Expect(serr).To(MatchError(&quic.StatelessResetError{}))
|
||||
statelessResetErr := &quic.StatelessResetError{}
|
||||
Expect(errors.As(serr, &statelessResetErr)).To(BeTrue())
|
||||
Expect(ln2.Close()).To(Succeed())
|
||||
Eventually(acceptStopped).Should(BeClosed())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user