Skip to content

Commit

Permalink
Test inspect output with dir
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Apr 8, 2024
1 parent 3629948 commit 9db3d9d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ fn test_env(#[case] env_var: &str) {
}

#[rstest]
#[case(false)]
#[case::within_folder(true)]
fn test_duplicate_file(#[case] in_folder: bool) {
#[case(false, false)]
#[case::inspect(false, true)]
#[case::within_folder(true, false)]
#[case::within_folder_inspect(true, true)]
fn test_duplicate_file(#[case] in_folder: bool, #[case] inspect: bool) {
let _env_lock = aquire_lock();

let test_env = TestEnv::new();
Expand All @@ -249,13 +251,20 @@ fn test_duplicate_file(#[case] in_folder: bool) {
}]
.to_vec(),
graveyard: Some(test_env.graveyard.clone()),
inspect,
..Args::default()
},
TestMode,
&mut log,
)
.unwrap();

let log_s = String::from_utf8(log).unwrap();
if inspect && in_folder {
assert!(log_s.contains("dir: directory"));
assert!(log_s.contains("to the graveyard? (y/N)"));
}

assert!(expected_graveyard_path1.exists());

// Bury the second file
Expand Down

0 comments on commit 9db3d9d

Please sign in to comment.