forked from quic-go/quic-go
simplify the stream by directly popping STREAM frames from it
This commit is contained in:
@@ -10,11 +10,23 @@ import (
|
||||
var _ = Describe("Stream", func() {
|
||||
var str *cryptoStream
|
||||
|
||||
str = newCryptoStream(nil, nil, protocol.VersionWhatever).(*cryptoStream)
|
||||
str = newCryptoStream(func() {}, nil, protocol.VersionWhatever).(*cryptoStream)
|
||||
|
||||
It("sets the read offset", func() {
|
||||
str.SetReadOffset(0x42)
|
||||
Expect(str.readOffset).To(Equal(protocol.ByteCount(0x42)))
|
||||
Expect(str.frameQueue.readPosition).To(Equal(protocol.ByteCount(0x42)))
|
||||
})
|
||||
|
||||
It("says if it has data for writing", func() {
|
||||
Expect(str.HasDataForWriting()).To(BeFalse())
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
defer GinkgoRecover()
|
||||
_, err := str.Write([]byte("foobar"))
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
close(done)
|
||||
}()
|
||||
Eventually(str.HasDataForWriting).Should(BeTrue())
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user