forked from quic-go/quic-go
@@ -371,36 +371,4 @@ var _ = Describe("StreamFrame", func() {
|
||||
Expect(f.getOffsetLength()).To(Equal(protocol.ByteCount(8)))
|
||||
})
|
||||
})
|
||||
|
||||
Context("splitting off earlier stream frames", func() {
|
||||
It("splits off nothing", func() {
|
||||
f := &StreamFrame{
|
||||
StreamID: 1,
|
||||
Data: []byte("bar"),
|
||||
Offset: 3,
|
||||
}
|
||||
Expect(f.MaybeSplitOffFrame(1000)).To(BeNil())
|
||||
Expect(f.Offset).To(Equal(protocol.ByteCount(3)))
|
||||
})
|
||||
|
||||
It("splits off initial frame", func() {
|
||||
f := &StreamFrame{
|
||||
StreamID: 1,
|
||||
Data: []byte("foobar"),
|
||||
Offset: 3,
|
||||
FinBit: true,
|
||||
}
|
||||
minLength, _ := f.MinLength()
|
||||
previous := f.MaybeSplitOffFrame(minLength - 1 + 3)
|
||||
Expect(previous).ToNot(BeNil())
|
||||
Expect(previous.StreamID).To(Equal(protocol.StreamID(1)))
|
||||
Expect(previous.Data).To(Equal([]byte("foo")))
|
||||
Expect(previous.Offset).To(Equal(protocol.ByteCount(3)))
|
||||
Expect(previous.FinBit).To(BeFalse())
|
||||
Expect(f.StreamID).To(Equal(protocol.StreamID(1)))
|
||||
Expect(f.Data).To(Equal([]byte("bar")))
|
||||
Expect(f.Offset).To(Equal(protocol.ByteCount(6)))
|
||||
Expect(f.FinBit).To(BeTrue())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user