diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 873f40052..bd9ba5898 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -300,6 +300,7 @@ fn runs_commands_using_user_defined_shell() { ); } +#[cfg(unix)] #[test] fn can_pass_input_to_command_from_a_file() { hyperfine() @@ -312,6 +313,20 @@ fn can_pass_input_to_command_from_a_file() { .stdout(predicate::str::contains("This text is part of a file")); } +#[cfg(windows)] +#[test] +fn can_pass_input_to_command_from_a_file() { + hyperfine() + .arg("--runs=1") + .arg("--input=example_input_file.txt") + .arg("--show-output") + .arg("type example_input_file.txt") + .assert() + .success() + .stdout(predicate::str::contains("This text is part of a file")); +} + +#[cfg(unix)] #[test] fn fails_if_invalid_stdin_data_file_provided() { hyperfine() @@ -326,6 +341,21 @@ fn fails_if_invalid_stdin_data_file_provided() { )); } +#[cfg(windows)] +#[test] +fn fails_if_invalid_stdin_data_file_provided() { + hyperfine() + .arg("--runs=1") + .arg("--input=example_non_existent_file.txt") + .arg("--show-output") + .arg("type example_non_existent_file.txt") + .assert() + .failure() + .stderr(predicate::str::contains( + "The file 'example_non_existent_file.txt' specified as '--input' does not exist", + )); +} + #[test] fn returns_mean_time_in_correct_unit() { hyperfine_debug()