pass a string, not an error, to Session.CloseWithError

This commit is contained in:
Marten Seemann 2019-05-12 13:45:40 +09:00
parent 6cdc228ef6
commit 0a86224858
7 changed files with 12 additions and 11 deletions

View file

@ -93,7 +93,7 @@ var _ = Describe("RoundTripper", func() {
Expect(err).ToNot(HaveOccurred())
session.EXPECT().OpenUniStreamSync().AnyTimes().Return(nil, testErr)
session.EXPECT().OpenStreamSync().Return(nil, testErr)
session.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).Do(func(quic.ErrorCode, error) { close(closed) })
session.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).Do(func(quic.ErrorCode, string) { close(closed) })
_, err = rt.RoundTrip(req)
Expect(err).To(MatchError(testErr))
Expect(rt.clients).To(HaveLen(1))
@ -130,7 +130,7 @@ var _ = Describe("RoundTripper", func() {
testErr := errors.New("test err")
session.EXPECT().OpenUniStreamSync().AnyTimes().Return(nil, testErr)
session.EXPECT().OpenStreamSync().Return(nil, testErr).Times(2)
session.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).Do(func(quic.ErrorCode, error) { close(closed) })
session.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).Do(func(quic.ErrorCode, string) { close(closed) })
req, err := http.NewRequest("GET", "https://quic.clemente.io/file1.html", nil)
Expect(err).ToNot(HaveOccurred())
_, err = rt.RoundTrip(req)