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

Function test_odd_capacity_split

rust/tests/simple_bug_tests.rs:40–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39#[test]
40fn test_odd_capacity_split() {
41 let mut tree = create_tree_5();
42
43 // Insert enough to force splits with odd capacity
44 insert_sequential_range(&mut tree, 10);
45
46 // Check leaf node sizes
47 let leaf_sizes = tree.leaf_sizes();
48 println!("Leaf sizes with capacity 5: {:?}", leaf_sizes);
49
50 // With capacity 5, min_keys = 2, so all non-empty leaves should have >= 2 keys
51 let min_keys = 2;
52 for &size in &leaf_sizes {
53 if size > 0 && size < min_keys {
54 panic!(
55 "Split created underfull leaf: {} keys < {} minimum",
56 size, min_keys
57 );
58 }
59 }
60}
61
62#[test]
63fn test_linked_list_integrity() {

Callers

nothing calls this directly

Calls 3

create_tree_5Function · 0.85
insert_sequential_rangeFunction · 0.85
leaf_sizesMethod · 0.80

Tested by

no test coverage detected