From 078c6df110d3bab8feeafad5ea8477772b29b7dc Mon Sep 17 00:00:00 2001 From: marvin-j97 Date: Thu, 26 Sep 2024 17:45:24 +0200 Subject: [PATCH] improve test assertions --- tests/snapshot_point_read.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/snapshot_point_read.rs b/tests/snapshot_point_read.rs index 9ae34d9a..f459c2a9 100644 --- a/tests/snapshot_point_read.rs +++ b/tests/snapshot_point_read.rs @@ -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(()) }