parent
5ee891cfea
commit
9b5859aea1
41 changed files with 39 additions and 1392 deletions
|
@ -278,26 +278,6 @@ fn test_extend_specialization() {
|
|||
assert_eq!(a.into_sorted_vec(), [-20, -10, 1, 2, 3, 3, 5, 43]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_placement() {
|
||||
let mut a = BinaryHeap::new();
|
||||
&mut a <- 2;
|
||||
&mut a <- 4;
|
||||
&mut a <- 3;
|
||||
assert_eq!(a.peek(), Some(&4));
|
||||
assert_eq!(a.len(), 3);
|
||||
&mut a <- 1;
|
||||
assert_eq!(a.into_sorted_vec(), vec![1, 2, 3, 4]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_placement_panic() {
|
||||
let mut heap = BinaryHeap::from(vec![1, 2, 3]);
|
||||
fn mkpanic() -> usize { panic!() }
|
||||
let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| { &mut heap <- mkpanic(); }));
|
||||
assert_eq!(heap.len(), 3);
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn assert_covariance() {
|
||||
fn drain<'new>(d: Drain<'static, &'static str>) -> Drain<'new, &'new str> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue