mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-02 09:01:25 +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"));
|
.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]
|
#[test]
|
||||||
fn fails_for_unknown_command() {
|
fn fails_for_unknown_command() {
|
||||||
hyperfine()
|
hyperfine()
|
||||||
|
|||||||
Reference in new issue
Block a user