summaryrefslogtreecommitdiffstats
path: root/lib/core
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-11-01 11:50:27 +0100
committerMatthias Beyer <mail@beyermatthias.de>2018-11-01 20:37:00 +0100
commitf01a262bdf4386bc67bc4e10f632523edd28ff20 (patch)
tree456605a5ba953402f6b106ba591464555dd901a8 /lib/core
parent3bf3a8890b275f304fe820f0bd4a9f009e31a654 (diff)
Add debugging output in test via logger
Diffstat (limited to 'lib/core')
-rw-r--r--lib/core/libimagstore/src/store.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs
index 6be591b6..64ab7fc4 100644
--- a/lib/core/libimagstore/src/store.rs
+++ b/lib/core/libimagstore/src/store.rs
@@ -987,7 +987,10 @@ Hai
fn test_entry_from_str() {
use super::Entry;
use std::path::PathBuf;
- println!("{}", TEST_ENTRY);
+
+ setup_logging();
+
+ debug!("{}", TEST_ENTRY);
let entry = Entry::from_str(StoreId::new_baseless(PathBuf::from("test/foo~1.3")).unwrap(),
TEST_ENTRY).unwrap();
@@ -998,7 +1001,10 @@ Hai
fn test_entry_to_str() {
use super::Entry;
use std::path::PathBuf;
- println!("{}", TEST_ENTRY);
+
+ setup_logging();
+
+ debug!("{}", TEST_ENTRY);
let entry = Entry::from_str(StoreId::new_baseless(PathBuf::from("test/foo~1.3")).unwrap(),
TEST_ENTRY).unwrap();
let string = entry.to_str().unwrap();
@@ -1010,7 +1016,10 @@ Hai
fn test_entry_to_str_trailing_newline() {
use super::Entry;
use std::path::PathBuf;
- println!("{}", TEST_ENTRY_TNL);
+
+ setup_logging();
+
+ debug!("{}", TEST_ENTRY_TNL);
let entry = Entry::from_str(StoreId::new_baseless(PathBuf::from("test/foo~1.3")).unwrap(),
TEST_ENTRY_TNL).unwrap();
let string = entry.to_str().unwrap();
@@ -1175,6 +1184,7 @@ mod store_tests {
#[test]
fn test_store_move_moves_in_hm() {
use storeid::StoreId;
+ setup_logging();
let store = get_store();
@@ -1197,7 +1207,7 @@ mod store_tests {
}
let r = store.move_by_id(id.clone(), id_mv.clone());
- assert!(r.map_err(|e| println!("ERROR: {:?}", e)).is_ok());
+ assert!(r.map_err(|e| debug!("ERROR: {:?}", e)).is_ok());
{
let id_mv_with_base = id_mv.clone().with_base(store.path().clone());