test: consolidate and prune redundant unit tests

Simplify the test suite by merging similar test cases and removing redundant assertions that verify trivial initialization and basic container logic.
This commit is contained in:
Nils Andreas Svee committed 2026-05-18 00:16:51 +07:00
1 parent 3b5336a487
commit e117813578
8 files changed
+35 -186

No files matched your search

+1 -16
View File
@@ -193,18 +193,6 @@ mod tests {
}
}
#[test]
fn pending_map_insert_and_remove() {
let mut map = PendingMap::new(10);
let now = Instant::now();
let probe = pending(0, now + Duration::from_secs(4));
map.insert(probe).unwrap();
assert_eq!(map.len(), 1);
assert!(map.remove(0).is_some());
assert_eq!(map.len(), 0);
assert!(map.remove(0).is_none());
}
#[test]
fn pending_map_rejects_over_capacity() {
let mut map = PendingMap::new(2);
@@ -220,7 +208,7 @@ mod tests {
}
#[test]
fn completed_set_tracks_and_evicts() {
fn bounded_probe_tracking_evicts_oldest_entries() {
let mut set = CompletedSet::new(3);
set.insert(0);
set.insert(1);
@@ -232,10 +220,7 @@ mod tests {
assert_eq!(set.set.len(), 3);
assert!(!set.contains(0));
assert!(set.contains(3));
}
#[test]
fn timed_out_map_tracks_and_evicts() {
let mut map = TimedOutMap::new(2);
let now = Instant::now();
map.insert(pending(0, now));