summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-11-06 18:17:46 +0100
committerMatthias Beyer <mail@beyermatthias.de>2018-11-06 18:17:46 +0100
commitdaaa4fd9cac860f74f0a6637aa6fd92b24851995 (patch)
tree69516ae841d5e98a3521fbf31707d4cebb4f0a1f
parentd982a657f8425e2f33e2d2e4391b50209b5b50ef (diff)
downloadimag-daaa4fd9cac860f74f0a6637aa6fd92b24851995.zip
imag-daaa4fd9cac860f74f0a6637aa6fd92b24851995.tar.gz
Make assert!() output more verbose
By printing the actual `Result<>` object that failed the assertion. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--lib/core/libimagstore/src/store.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs
index e4bb1a6..91cee86 100644
--- a/lib/core/libimagstore/src/store.rs
+++ b/lib/core/libimagstore/src/store.rs
@@ -1220,10 +1220,13 @@ mod store_tests {
assert!(store.entries.read().unwrap().get(&id_mv_with_base).is_some());
}
- assert!(match store.get(id.clone()) { Ok(None) => true, _ => false },
- "Moved id ({:?}) is still there", id);
- assert!(match store.get(id_mv.clone()) { Ok(Some(_)) => true, _ => false },
- "New id ({:?}) is not in store...", id_mv);
+ let res = store.get(id.clone());
+ assert!(match res { Ok(None) => true, _ => false },
+ "Moved id ({:?}) is still there: {:?}", id, res);
+
+ let res = store.get(id_mv.clone());
+ assert!(match res { Ok(Some(_)) => true, _ => false },
+ "New id ({:?}) is not in store: {:?}", id_mv, res);
}
}
}