2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(unused_variables)]
|
2016-01-17 11:26:01 -06:00
|
|
|
use std::collections::BinaryHeap;
|
|
|
|
use std::iter::Iterator;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
const N: usize = 8;
|
|
|
|
|
|
|
|
for len in 0..N {
|
|
|
|
let mut tester = BinaryHeap::with_capacity(len);
|
|
|
|
assert_eq!(tester.len(), 0);
|
|
|
|
assert!(tester.capacity() >= len);
|
|
|
|
for bit in 0..len {
|
|
|
|
tester.push(());
|
|
|
|
}
|
|
|
|
assert_eq!(tester.len(), len);
|
|
|
|
assert_eq!(tester.iter().count(), len);
|
|
|
|
tester.clear();
|
|
|
|
}
|
|
|
|
}
|