Lines
100 %
Functions
Branches
use super::Seq;
#[test]
fn only_the_latest_request_is_awaited() {
let mut seq = Seq::default();
let first = seq.advance();
let second = seq.advance();
assert_ne!(first, second);
assert!(!seq.awaits(first));
assert!(seq.awaits(second));
}
fn the_counter_wraps_instead_of_overflowing() {
let mut seq = Seq(u64::MAX);
let wrapped = seq.advance();
assert_eq!(wrapped, 0);
assert!(seq.awaits(0));
fn the_current_id_is_the_latest_started() {
let started = seq.advance();
assert_eq!(seq.current(), started);