ackhandler: rename variables to follow RFC 9002 terminology (#4062)

This commit is contained in:
Marten Seemann 2023-09-04 11:45:41 +07:00 committed by GitHub
parent 6cde43785f
commit 96b1943cf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 35 deletions

View file

@ -25,26 +25,26 @@ var _ = Describe("Received Packet Tracker", func() {
Context("accepting packets", func() {
It("saves the time when each packet arrived", func() {
Expect(tracker.ReceivedPacket(protocol.PacketNumber(3), protocol.ECNNon, time.Now(), true)).To(Succeed())
Expect(tracker.largestObservedReceivedTime).To(BeTemporally("~", time.Now(), 10*time.Millisecond))
Expect(tracker.largestObservedRcvdTime).To(BeTemporally("~", time.Now(), 10*time.Millisecond))
})
It("updates the largestObserved and the largestObservedReceivedTime", func() {
It("updates the largestObserved and the largestObservedRcvdTime", func() {
now := time.Now()
tracker.largestObserved = 3
tracker.largestObservedReceivedTime = now.Add(-1 * time.Second)
tracker.largestObservedRcvdTime = now.Add(-1 * time.Second)
Expect(tracker.ReceivedPacket(5, protocol.ECNNon, now, true)).To(Succeed())
Expect(tracker.largestObserved).To(Equal(protocol.PacketNumber(5)))
Expect(tracker.largestObservedReceivedTime).To(Equal(now))
Expect(tracker.largestObservedRcvdTime).To(Equal(now))
})
It("doesn't update the largestObserved and the largestObservedReceivedTime for a belated packet", func() {
It("doesn't update the largestObserved and the largestObservedRcvdTime for a belated packet", func() {
now := time.Now()
timestamp := now.Add(-1 * time.Second)
tracker.largestObserved = 5
tracker.largestObservedReceivedTime = timestamp
tracker.largestObservedRcvdTime = timestamp
Expect(tracker.ReceivedPacket(4, protocol.ECNNon, now, true)).To(Succeed())
Expect(tracker.largestObserved).To(Equal(protocol.PacketNumber(5)))
Expect(tracker.largestObservedReceivedTime).To(Equal(timestamp))
Expect(tracker.largestObservedRcvdTime).To(Equal(timestamp))
})
})