From c0ce6b9537e29fae6f170b8d3de47a8bcf8d9637 Mon Sep 17 00:00:00 2001 From: David Peter Date: Mon, 21 Feb 2022 08:59:57 +0100 Subject: [PATCH] Add integration test for '--shell' --- tests/integration_tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 60a9109..048955e 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -137,3 +137,20 @@ fn can_run_failing_commands_with_ignore_failure_option() { .assert() .success(); } + +#[test] +fn runs_commands_using_user_defined_shell() { + hyperfine() + .arg("--runs=1") + .arg("--show-output") + .arg("--shell") + .arg("echo 'custom_shell' '--shell-arg'") + .arg("echo benchmark") + .assert() + .success() + .stdout( + predicate::str::contains("custom_shell --shell-arg -c echo benchmark").or( + predicate::str::contains("custom_shell --shell-arg /C echo benchmark"), + ), + ); +}