Add PureQueue length check to existing rust tests

This commit is contained in:
Michael Bradley 2025-01-13 22:10:08 +13:00
parent 63515e2314
commit 57fdba96fe
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8

View file

@ -9,6 +9,7 @@ mod tests {
heap.add(-3);
heap.add(6);
heap.add(1);
assert_eq!(heap.len(), 4);
assert_eq!(heap.pop(), Some(-3));
assert_eq!(heap.pop(), Some(1));
assert_eq!(heap.pop(), Some(4));
@ -19,6 +20,7 @@ mod tests {
#[test]
fn test_pure_binary_heap_from_iter() {
let mut heap = BinaryHeap::from_iter(vec![7, 3, 6, 9]);
assert_eq!(heap.len(), 4);
assert_eq!(heap.pop(), Some(3));
assert_eq!(heap.pop(), Some(6));
assert_eq!(heap.pop(), Some(7));