Skip to content

Commit

Permalink
Add a test for zero slab capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0246 committed Oct 20, 2024
1 parent 207a3f7 commit 90f3d8e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,12 @@ mod tests {
assert!((z.as_ptr() as usize).abs_diff(x.as_ptr() as usize) >= MIN_DIFF);
}

#[test]
#[should_panic]
fn zero_slab_capacity() {
let _ = SlabAllocator::<()>::new(0);
}

#[cfg(debug_assertions)]
#[test]
#[should_panic]
Expand Down

0 comments on commit 90f3d8e

Please sign in to comment.