MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / verify_ordering_int

Function verify_ordering_int

rust/tests/test_utils.rs:322–329  ·  view source on GitHub ↗

Verify tree ordering for integer trees

(tree: &BPlusTreeMap<i32, i32>)

Source from the content-addressed store, hash-verified

320
321/// Verify tree ordering for integer trees
322pub fn verify_ordering_int(tree: &BPlusTreeMap<i32, i32>) {
323 let items: Vec<_> = tree.items().collect();
324 for i in 1..items.len() {
325 if items[i - 1].0 >= items[i].0 {
326 panic!("Items out of order after operations!");
327 }
328 }
329}
330
331/// Verify tree has expected number of items
332pub fn verify_item_count(tree: &BPlusTreeMap<i32, String>, expected: usize, context: &str) {

Callers 1

Calls 2

itemsMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected