mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 17:00:18 +00:00
ran cargo fmt
This commit is contained in:
1 parent
e38acdb683
commit
0e3bad1391
3 files changed
+14
-11
No files matched your search
@@ -1,7 +1,9 @@
|
||||
use std::process::{ExitStatus, Stdio};
|
||||
|
||||
use crate::command::Command;
|
||||
use crate::options::{CmdFailureAction, CommandInputPolicy, CommandOutputPolicy, Options, OutputStyleOption, Shell};
|
||||
use crate::options::{
|
||||
CmdFailureAction, CommandInputPolicy, CommandOutputPolicy, Options, OutputStyleOption, Shell,
|
||||
};
|
||||
use crate::output::progress_bar::get_progress_bar;
|
||||
use crate::timer::{execute_and_measure, TimerResult};
|
||||
use crate::util::randomized_environment_offset;
|
||||
|
||||
+3
-2
@@ -231,7 +231,6 @@ pub struct Options {
|
||||
|
||||
/// Where input to the benchmarked command comes from
|
||||
pub command_input_policy: CommandInputPolicy,
|
||||
|
||||
}
|
||||
|
||||
impl Default for Options {
|
||||
@@ -392,7 +391,9 @@ impl Options {
|
||||
options.command_input_policy = if let Some(path_str) = matches.value_of("stdin-data") {
|
||||
let path = PathBuf::from(path_str);
|
||||
if !path.exists() {
|
||||
return Err(OptionsError::StdinDataFileDoesNotExist(path_str.to_string()))
|
||||
return Err(OptionsError::StdinDataFileDoesNotExist(
|
||||
path_str.to_string(),
|
||||
));
|
||||
}
|
||||
CommandInputPolicy::File(path)
|
||||
} else {
|
||||
|
||||
@@ -216,7 +216,7 @@ fn runs_commands_using_user_defined_shell() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_pass_file_data_to_command_via_stdin(){
|
||||
fn can_pass_file_data_to_command_via_stdin() {
|
||||
hyperfine()
|
||||
.arg("--runs=1")
|
||||
.arg("--stdin-data=example_stdin_data")
|
||||
@@ -224,13 +224,13 @@ fn can_pass_file_data_to_command_via_stdin(){
|
||||
.arg("cat")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(
|
||||
predicate::str::contains("This data is passed to the command via stdin")
|
||||
);
|
||||
.stdout(predicate::str::contains(
|
||||
"This data is passed to the command via stdin",
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fails_if_invalid_stdin_data_file_provided(){
|
||||
fn fails_if_invalid_stdin_data_file_provided() {
|
||||
hyperfine()
|
||||
.arg("--runs=1")
|
||||
.arg("--stdin-data=example_stdin_data_invalid")
|
||||
@@ -238,9 +238,9 @@ fn fails_if_invalid_stdin_data_file_provided(){
|
||||
.arg("cat")
|
||||
.assert()
|
||||
.failure()
|
||||
.stderr(
|
||||
predicate::str::contains("File containing stdin data 'example_stdin_data_invalid' does not exist")
|
||||
);
|
||||
.stderr(predicate::str::contains(
|
||||
"File containing stdin data 'example_stdin_data_invalid' does not exist",
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user