Skip to content

Commit

Permalink
add logging for test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
benluiwj committed Jun 28, 2024
1 parent 49b49da commit 7bc1b8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions check_diff/tests/bash_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use check_diff::change_directory_to_path;
use std::env;
use std::ffi::OsStr;
use tempfile::Builder;
use tracing::error;

#[test]
fn cd_test() {
Expand All @@ -20,13 +21,13 @@ fn cd_test() {
match d.close() {
Ok(_) => {}
Err(e) => {
println!("Error from closing: {}", e);
error!("Error from closing: {}", e);
assert_eq!(1, 2);
}
}
}
Err(e) => {
println!("Error from building: {}", e);
error!("Error from building: {}", e);
assert_eq!(1, 2);
}
};
Expand Down
7 changes: 5 additions & 2 deletions check_diff/tests/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use check_diff::clone_git_repo;

use std::fs;
use tempfile::Builder;
use tracing::error;

#[test]
fn clone_repo_test() {
Expand All @@ -19,12 +20,14 @@ fn clone_repo_test() {
assert_eq!(directory.iter().next().is_none(), false);
match d.close() {
Ok(_) => {}
Err(_) => {
Err(e) => {
error!("Error from closing: {}", e);
assert_eq!(1, 2);
}
}
}
Err(_) => {
Err(e) => {
error!("Error from building: {}", e);
assert_eq!(1, 2);
}
}
Expand Down

0 comments on commit 7bc1b8e

Please sign in to comment.