Add debugging output in test via logger

This commit is contained in:
Matthias Beyer 2018-11-01 11:49:54 +01:00
parent 089d5b98cb
commit 3bf3a8890b
2 changed files with 14 additions and 3 deletions

View file

@ -581,23 +581,24 @@ pub mod header_filter_lang {
#[test] #[test]
fn test_list_of_val() { fn test_list_of_val() {
setup_logging();
{ {
let list = list_of_val(b"[]"); let list = list_of_val(b"[]");
println!("list: {:?}", list); debug!("list: {:?}", list);
let vals = list.unwrap().1; let vals = list.unwrap().1;
assert_eq!(vals, vec![]); assert_eq!(vals, vec![]);
} }
{ {
let list = list_of_val(b"[1]"); let list = list_of_val(b"[1]");
println!("list: {:?}", list); debug!("list: {:?}", list);
let vals = list.unwrap().1; let vals = list.unwrap().1;
assert_eq!(vals, vec![Value::Integer(1)]); assert_eq!(vals, vec![Value::Integer(1)]);
} }
{ {
let list = list_of_val(b"[12,13]"); let list = list_of_val(b"[12,13]");
println!("list: {:?}", list); debug!("list: {:?}", list);
let vals = list.unwrap().1; let vals = list.unwrap().1;
assert_eq!(vals, vec![Value::Integer(12), Value::Integer(13)]); assert_eq!(vals, vec![Value::Integer(12), Value::Integer(13)]);
} }

View file

@ -921,6 +921,10 @@ mod test {
use toml::Value; use toml::Value;
fn setup_logging() {
let _ = env_logger::try_init();
}
#[test] #[test]
fn test_imag_section() { fn test_imag_section() {
let mut map = BTreeMap::new(); let mut map = BTreeMap::new();
@ -1017,9 +1021,15 @@ Hai
#[cfg(test)] #[cfg(test)]
mod store_tests { mod store_tests {
extern crate env_logger;
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
fn setup_logging() {
let _ = env_logger::try_init();
}
use super::Store; use super::Store;
use file_abstraction::InMemoryFileAbstraction; use file_abstraction::InMemoryFileAbstraction;