diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index d4adeff..1e235b0 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -32,6 +32,30 @@ fn fails_with_wrong_number_of_command_name_arguments() { .stderr(predicate::str::contains("Too many --command-name options")); } +#[test] +fn fails_with_wrong_number_of_prepare_options() { + hyperfine() + .arg("--runs=1") + .arg("--prepare=echo a") + .arg("--prepare=echo b") + .arg("echo a") + .arg("echo b") + .assert() + .success(); + + hyperfine() + .arg("--prepare=echo a") + .arg("--prepare=echo b") + .arg("echo a") + .arg("echo b") + .arg("echo c") + .assert() + .failure() + .stderr(predicate::str::contains( + "The '--prepare' option has to be provided", + )); +} + #[test] fn fails_for_unknown_command() { hyperfine()