update test to drop the trees
@@ -1059,13 +1059,17 @@ fn create_tree() {
#[test]
fn contains_tree() {
let db = Config::new().temporary(true).flush_every_ms(None).open().unwrap();
- let _tree_one = db.open_tree("tree 1").unwrap();
- let _tree_two = db.open_tree("tree 2").unwrap();
+ let tree_one = db.open_tree("tree 1").unwrap();
+ let tree_two = db.open_tree("tree 2").unwrap();
+
+ drop(tree_one);
+ drop(tree_two);
+
assert_eq!(false, db.contains_tree("tree 3").unwrap());
assert_eq!(true, db.contains_tree("tree 1").unwrap());
assert_eq!(true, db.contains_tree("tree 2").unwrap());
- let _del_tree_one = db.drop_tree("tree 1").unwrap();
+ assert!(db.drop_tree("tree 1").unwrap());
assert_eq!(false, db.contains_tree("tree 1").unwrap());
}
