Skip to content

Commit

Permalink
improve test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Sep 26, 2024
1 parent ea1c6a0 commit 078c6df
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/snapshot_point_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ fn snapshot_404() -> lsm_tree::Result<()> {

tree.flush_active_memtable(0)?;

assert!(tree.get("a")?.is_some());
assert!(tree.get("a2")?.is_some());
assert_eq!(b"a", &*tree.get("a")?.unwrap());
assert_eq!(b"a2", &*tree.get("a2")?.unwrap());
assert!(tree.get("b")?.is_none());
assert!(tree.get("c")?.is_some());
assert_eq!(b"c", &*tree.get("c")?.unwrap());

assert!(tree.get_with_seqno("a", 0)?.is_none());
assert!(tree.get_with_seqno("a2", 0)?.is_none());
assert!(tree.get_with_seqno("b", 0)?.is_none());
assert!(tree.get_with_seqno("c", 0)?.is_none());

assert!(tree.get_with_seqno("a", 1)?.is_some());
assert!(tree.get_with_seqno("a2", 1)?.is_some());
assert_eq!(b"a", &*tree.get_with_seqno("a", 1)?.unwrap());
assert_eq!(b"a2", &*tree.get_with_seqno("a2", 1)?.unwrap());
assert!(tree.get_with_seqno("b", 1)?.is_none());
assert!(tree.get_with_seqno("c", 1)?.is_some());
assert_eq!(b"c", &*tree.get_with_seqno("c", 1)?.unwrap());

Ok(())
}
Expand Down

0 comments on commit 078c6df

Please sign in to comment.