Add debugging output in test via logger

This commit is contained in:
Matthias Beyer 2018-11-01 11:50:27 +01:00
parent 3bf3a8890b
commit f01a262bdf

View file

@ -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());