diff --git a/crates/store/src/avl/tests.rs b/crates/store/src/avl/tests.rs index 8733055c..36cb37af 100644 --- a/crates/store/src/avl/tests.rs +++ b/crates/store/src/avl/tests.rs @@ -40,6 +40,23 @@ fn get() { assert_eq!(tree.get(&[4]), None); } +#[test] +fn shuffle_get() { + let mut tree = AvlTree::new(); + + let mut keys: Vec = (0..100).collect(); + + keys.shuffle(&mut thread_rng()); + for &i in keys.iter() { + tree.insert([i], vec![i]); + } + + keys.shuffle(&mut thread_rng()); + for &i in keys.iter() { + assert_eq!(tree.get(&[i]), Some(&vec![i])); + } +} + #[test] fn shuffle_remove() { let mut tree = AvlTree::new();