mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 16:18:57 +00:00
Add integration test for prepare option
This commit is contained in:
1 parent
b3c0022386
commit
4d3314f26f
1 file changed
+24
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user