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

Function test_iterator_consistency

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

Source from the content-addressed store, hash-verified

191
192#[test]
193fn test_iterator_consistency() {
194 let mut tree = create_tree_4();
195
196 insert_sequential_range(&mut tree, 10);
197
198 // Multiple iterations should give same results
199 let iter1: Vec<_> = tree.items().map(|(k, _)| *k).collect();
200 let iter2: Vec<_> = tree.items().map(|(k, _)| *k).collect();
201
202 assert_eq!(iter1, iter2, "Multiple iterations should be consistent");
203
204 // Range iteration should be consistent with full iteration
205 let range_all: Vec<_> = tree.range(..).map(|(k, _)| *k).collect();
206
207 assert_eq!(iter1, range_all, "Range(..) should match full iteration");
208}
209
210#[test]
211fn test_arena_utilization() {

Callers

nothing calls this directly

Calls 4

create_tree_4Function · 0.85
insert_sequential_rangeFunction · 0.85
itemsMethod · 0.45
rangeMethod · 0.45

Tested by

no test coverage detected