crypto_stream_test.go 640 B

1234567891011121314151617181920212223242526
  1. package quic
  2. import (
  3. "github.com/lucas-clemente/quic-go/internal/protocol"
  4. . "github.com/onsi/ginkgo"
  5. . "github.com/onsi/gomega"
  6. )
  7. var _ = Describe("Crypto Stream", func() {
  8. var (
  9. str *cryptoStreamImpl
  10. mockSender *MockStreamSender
  11. )
  12. BeforeEach(func() {
  13. mockSender = NewMockStreamSender(mockCtrl)
  14. str = newCryptoStream(mockSender, nil, protocol.VersionWhatever).(*cryptoStreamImpl)
  15. })
  16. It("sets the read offset", func() {
  17. str.setReadOffset(0x42)
  18. Expect(str.receiveStream.readOffset).To(Equal(protocol.ByteCount(0x42)))
  19. Expect(str.receiveStream.frameQueue.readPos).To(Equal(protocol.ByteCount(0x42)))
  20. })
  21. })