mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 16:18:57 +00:00
34 lines
669 B
Rust
34 lines
669 B
Rust
mod common;
|
|
use common::hyperfine;
|
|
|
|
use predicates::prelude::*;
|
|
|
|
#[test]
|
|
fn hyperfine_runs_successfully() {
|
|
hyperfine()
|
|
.arg("--runs=2")
|
|
.arg("echo dummy benchmark")
|
|
.assert()
|
|
.success();
|
|
}
|
|
|
|
#[test]
|
|
fn one_run_is_supported() {
|
|
hyperfine()
|
|
.arg("--runs=1")
|
|
.arg("echo dummy benchmark")
|
|
.assert()
|
|
.success();
|
|
}
|
|
|
|
#[test]
|
|
fn fails_with_wrong_number_of_command_name_arguments() {
|
|
hyperfine()
|
|
.arg("--command-name=a")
|
|
.arg("--command-name=b")
|
|
.arg("echo a")
|
|
.assert()
|
|
.failure()
|
|
.stderr(predicate::str::contains("Too many --command-name options"));
|
|
}
|