forked from quic-go/quic-go
calculate correct MinLength of an ACK frame with a contiguous NACK range
fixes #183
This commit is contained in:
@@ -512,7 +512,7 @@ var _ = Describe("AckFrame", func() {
|
||||
Expect(f.MinLength(0)).To(Equal(protocol.ByteCount(b.Len())))
|
||||
})
|
||||
|
||||
It("has proper min length with nack ranges", func() {
|
||||
It("has proper min length with NACK ranges", func() {
|
||||
f := &AckFrame{
|
||||
Entropy: 2,
|
||||
LargestObserved: 4,
|
||||
@@ -522,6 +522,17 @@ var _ = Describe("AckFrame", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(f.MinLength(0)).To(Equal(protocol.ByteCount(b.Len())))
|
||||
})
|
||||
|
||||
It("has proper min length with a continuous NACK ranges", func() {
|
||||
f := &AckFrame{
|
||||
Entropy: 2,
|
||||
LargestObserved: 3000,
|
||||
NackRanges: []NackRange{{FirstPacketNumber: 2, LastPacketNumber: 2000}},
|
||||
}
|
||||
err := f.Write(b, protocol.Version31)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(f.MinLength(0)).To(Equal(protocol.ByteCount(b.Len())))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user