From 2a407d161b905bc7da52f9bb0e4804ae3f07e53e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 26 Oct 2019 09:54:54 +0200 Subject: [PATCH] Add some debug output Signed-off-by: Matthias Beyer --- lib/core/libimagstore/src/store.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs index 24b57052..49f76164 100644 --- a/lib/core/libimagstore/src/store.rs +++ b/lib/core/libimagstore/src/store.rs @@ -1196,22 +1196,29 @@ mod store_tests { let id = StoreId::new(PathBuf::from(format!("t-{}", n))).unwrap(); let id_mv = StoreId::new(PathBuf::from(format!("t-{}", n - 1))).unwrap(); + debug!("Trying to move: {} -> {}", id, id_mv); + { + debug!("Checking presence: {}", id); assert!(store.entries.read().unwrap().get(&id).is_none()); } { + debug!("Creating : {}", id); assert!(store.create(id.clone()).is_ok()); } { + debug!("Checking presence: {}", id); assert!(store.entries.read().unwrap().get(&id).is_some()); } + debug!("Moving: {} -> {}", id, id_mv); let r = store.move_by_id(id.clone(), id_mv.clone()); assert!(r.map_err(|e| debug!("ERROR: {:?}", e)).is_ok()); { + debug!("Checking presence: {}", id_mv); assert!(store.entries.read().unwrap().get(&id_mv).is_none()); // entry not in cache yet assert!(store.get(id_mv.clone()).unwrap().is_some()); // get entry from backend assert!(store.entries.read().unwrap().get(&id_mv).is_some()); // entry in cache