}
#[test]
pub fn del_leaf() {
env_logger::try_init().unwrap_or(());
let env = Env::new_anon(409600000, 1).unwrap();
let mut txn = Env::mut_txn_begin(&env).unwrap();
let mut db: Db<u64, u64> = create_db(&mut txn).unwrap();
let n = 20 as u64;
let i0 = 10 as u64;
let mut values = Vec::with_capacity(n as usize);
for i in 0..n {
put(&mut txn, &mut db, &i, &i).unwrap();
if i != i0 {
values.push(i);
}
}
let db2 = fork_db(&mut txn, &db).unwrap();
del(&mut txn, &mut db, &i0, None).unwrap();
assert_eq!(
btree::iter(&txn, &db, None)
.unwrap()
.map(|kv| *kv.unwrap().0)
.collect::<Vec<_>>(),
values
);