Add integration test for prepare option

This commit is contained in:
David Peter authored and David Peter committed 2022-02-06 20:19:50 +01:00
1 parent b3c0022386
commit 4d3314f26f
1 file changed
+24
+24
View File
@@ -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()