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

Function test_remove_single_item_from_leaf_root

rust/tests/bplus_tree.rs:210–225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208
209#[test]
210fn test_remove_single_item_from_leaf_root() {
211 let mut tree = create_tree_4();
212 tree.insert(1, "one".to_string());
213
214 // Remove the item
215 let removed = tree.remove(&1);
216
217 // Tree should be empty
218 assert_eq!(removed, Some("one".to_string()));
219 assert_eq!(tree.len(), 0);
220 assert!(!tree.contains_key(&1));
221 assert_invariants(&tree, "remove single item");
222
223 // Should return None when trying to get removed item
224 assert_eq!(tree.get(&1), None);
225}
226
227#[test]
228fn test_remove_multiple_items_from_leaf_root() {

Callers

nothing calls this directly

Calls 4

create_tree_4Function · 0.85
assert_invariantsFunction · 0.85
insertMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected