Skip to content

Commit

Permalink
test: iter lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Jul 11, 2024
1 parent 330d2c9 commit 62ce05a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/tree_iter_lifetime.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use lsm_tree::{UserKey, UserValue};
use std::path::Path;

fn iterrr(
path: &Path,
) -> lsm_tree::Result<impl DoubleEndedIterator<Item = lsm_tree::Result<(UserKey, UserValue)>>> {
let tree = lsm_tree::Config::new(path).open()?;

for x in 0..100u32 {
let x = x.to_be_bytes();
tree.insert(x, x, 0);
}

Ok(tree.iter())
}

#[test_log::test]
fn segment_reader_mvcc_slab() -> lsm_tree::Result<()> {
let folder = tempfile::tempdir().unwrap();
assert_eq!(100, iterrr(folder.path())?.count());
Ok(())
}

0 comments on commit 62ce05a

Please sign in to comment.