split the Session.Close(error) in Close() and CloseWithError(error)

This commit is contained in:
Marten Seemann 2018-07-04 17:04:50 +07:00
parent 2bc5b7f532
commit 8b2992a243
22 changed files with 168 additions and 105 deletions

View file

@ -1,7 +1,6 @@
package quic
import (
"errors"
"time"
"github.com/lucas-clemente/quic-go/internal/protocol"
@ -46,13 +45,12 @@ var _ = Describe("Packet Handler Map", func() {
})
It("closes", func() {
testErr := errors.New("test error")
sess1 := NewMockQuicSession(mockCtrl)
sess1.EXPECT().Close(testErr)
sess1.EXPECT().Close()
sess2 := NewMockQuicSession(mockCtrl)
sess2.EXPECT().Close(testErr)
sess2.EXPECT().Close()
handler.Add(protocol.ConnectionID{1, 1, 1, 1}, sess1)
handler.Add(protocol.ConnectionID{2, 2, 2, 2}, sess2)
handler.Close(testErr)
handler.Close()
})
})