Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test
Browse files Browse the repository at this point in the history
mxinden committed Aug 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 7b1d306 commit f183df8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions neqo-transport/src/pace.rs
Original file line number Diff line number Diff line change
@@ -177,4 +177,18 @@ mod tests {
p.spend(n, RTT, CWND, PACKET);
assert_eq!(p.next(RTT, CWND), n);
}

#[test]
fn send_immediately_below_granularity() {
const SHORT_RTT: Duration = Duration::from_millis(10);
let n = now();
let mut p = Pacer::new(true, n, PACKET, PACKET);
assert_eq!(p.next(SHORT_RTT, CWND), n);
p.spend(n, SHORT_RTT, CWND, PACKET);
assert_eq!(
p.next(SHORT_RTT, CWND),
n,
"Expect packet to be sent immediately, instead of being paced below timer granularity."
);
}
}

0 comments on commit f183df8

Please sign in to comment.