Skip to content

Commit

Permalink
add failing test for issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
droundy committed Sep 15, 2022
1 parent 2ac4367 commit c82bcc0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/setu32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2161,3 +2161,9 @@ fn test_remove() {

test_insert_remove(5, &mut [0, 0, 2]);
}

#[test]
#[should_panic]
fn test_alloc_failure() {
SetU32::with_capacity_and_bits(usize::MAX / 8 - 2, 0);
}
6 changes: 6 additions & 0 deletions src/setu64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,12 @@ fn test_a_collect(v: Vec<u64>) {
assert_eq!(vv, vvv);
}

#[test]
#[should_panic]
fn test_alloc_failure() {
SetU64::with_capacity_and_bits(usize::MAX / 8 - 2, 0);
}

#[test]
fn test_collect() {
test_a_collect(vec![]);
Expand Down

0 comments on commit c82bcc0

Please sign in to comment.