Skip to content

Commit

Permalink
Add test for empty arc
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Dec 11, 2024
1 parent c1a8163 commit 1b5134b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/api/src/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ mod tests {
assert!(!arc.contains(33));
}

#[test]
fn contains_empty_arc_no_locations() {
let arc = DhtArc::Empty;

assert!(!arc.contains(0));
assert!(!arc.contains(u32::MAX));
assert!(!arc.contains(u32::MAX / 2));
}

#[test]
fn arc_dist_edge_cases() {
type Dist = u32;
Expand Down

0 comments on commit 1b5134b

Please sign in to comment.