aboutsummaryrefslogtreecommitdiff
path: root/src/db/test.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-03 04:44:40 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-03 04:44:40 +0200
commit7b7990635029776e8878f3b04ed7ca48192899a3 (patch)
tree36d87f483b89c55153c59a68d7b1720f67fa3941 /src/db/test.rs
parent6ebb54cddb3ac21f7384720b8336995a8889d20d (diff)
downloadgarage-7b7990635029776e8878f3b04ed7ca48192899a3.tar.gz
garage-7b7990635029776e8878f3b04ed7ca48192899a3.zip
Drop later
Diffstat (limited to 'src/db/test.rs')
-rw-r--r--src/db/test.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/db/test.rs b/src/db/test.rs
index 20ebd54b..78d755cf 100644
--- a/src/db/test.rs
+++ b/src/db/test.rs
@@ -43,6 +43,7 @@ fn test_suite(db: Db) {
let mut iter = tree.iter().unwrap();
assert_eq!(iter.next().unwrap().unwrap(), (ka.into(), vb.into()));
assert!(iter.next().is_none());
+ drop(iter);
tree.insert(kb, vc).unwrap();
assert_eq!(tree.get(kb).unwrap(), Some(vc.into()));
@@ -51,19 +52,23 @@ fn test_suite(db: Db) {
assert_eq!(iter.next().unwrap().unwrap(), (ka.into(), vb.into()));
assert_eq!(iter.next().unwrap().unwrap(), (kb.into(), vc.into()));
assert!(iter.next().is_none());
+ drop(iter);
let mut iter = tree.range(kint..).unwrap();
assert_eq!(iter.next().unwrap().unwrap(), (kb.into(), vc.into()));
assert!(iter.next().is_none());
+ drop(iter);
let mut iter = tree.range_rev(..kint).unwrap();
assert_eq!(iter.next().unwrap().unwrap(), (ka.into(), vb.into()));
assert!(iter.next().is_none());
+ drop(iter);
let mut iter = tree.iter_rev().unwrap();
assert_eq!(iter.next().unwrap().unwrap(), (kb.into(), vc.into()));
assert_eq!(iter.next().unwrap().unwrap(), (ka.into(), vb.into()));
assert!(iter.next().is_none());
+ drop(iter);
}
#[test]