Skip to content

Commit

Permalink
updated test for heap allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Blindspot22 committed Aug 7, 2024
1 parent f7273cf commit 5fcb91b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/heap_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,13 @@ fn many_boxes() {
assert_eq!(*x, i);
}
}

#[test_case]
fn many_boxes_long_lived() {
let long_lived = Box::new(1); // new
for i in 0..HEAP_SIZE {
let x = Box::new(i);
assert_eq!(*x, i);
}
assert_eq!(*long_lived, 1); // new
}

0 comments on commit 5fcb91b

Please sign in to comment.