std_macro_extensions/binary_heap/
cfg.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[test]
fn test_empty_binary_heap() {
    use crate::*;
    let heap: BinaryHeap<i32> = binary_heap!();
    assert!(heap.is_empty());
}

#[test]
fn test_binary_heap_with_elements() {
    use crate::*;
    let heap: BinaryHeap<i32> = binary_heap!(5, 3, 8, 1);
    let vec: Vec<i32> = heap.into_sorted_vec();
    assert_eq!(vec, vec![1, 3, 5, 8]);
}