ran cargo fmt
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Steve Nease · committed by David Peter · parent e38acdb · Browse files · 3 files·+14 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+14 added−11 removed
- tests:+8 added−8 removed
- other:+6 added−3 removed
Provenance
- Commit
0e3bad1- Tree
6b98cea- Author
Steve Nease <stephen.h.nease@gmail.com>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
e38acdb
3 files changed+14 added−11 removed
modified:src/benchmark/executor.rs+3 added-1 removed
1 use std::process::{ExitStatus, Stdio};2 3 use crate::command::Command;4-use crate::options::{CmdFailureAction, CommandInputPolicy, CommandOutputPolicy, Options, OutputStyleOption, Shell};4+use crate::options::{5+ CmdFailureAction, CommandInputPolicy, CommandOutputPolicy, Options, OutputStyleOption, Shell,6+};7 use crate::output::progress_bar::get_progress_bar;8 use crate::timer::{execute_and_measure, TimerResult};9 use crate::util::randomized_environment_offset;10 use crate::util::units::Second;289 unmodified linesmodified:src/options.rs+3 added-2 removed
229 unmodified lines230 pub time_unit: Option<Unit>,231 232 /// Where input to the benchmarked command comes from233 pub command_input_policy: CommandInputPolicy,234-234 }235 236 impl Default for Options {237 fn default() -> Options {152 unmodified lines390 391 options.command_input_policy = if let Some(path_str) = matches.value_of("stdin-data") {392 let path = PathBuf::from(path_str);393 if !path.exists() {395- return Err(OptionsError::StdinDataFileDoesNotExist(path_str.to_string()))394+ return Err(OptionsError::StdinDataFileDoesNotExist(395+ path_str.to_string(),396+ ));397 }398 CommandInputPolicy::File(path)399 } else {400 CommandInputPolicy::Null62 unmodified linesmodified:tests/integration_tests.rs+8 added-8 removed
214 unmodified lines215 );216 }217 218 #[test]219-fn can_pass_file_data_to_command_via_stdin(){219+fn can_pass_file_data_to_command_via_stdin() {220 hyperfine()221 .arg("--runs=1")222 .arg("--stdin-data=example_stdin_data")223 .arg("--show-output")224 .arg("cat")225 .assert()226 .success()227- .stdout(228- predicate::str::contains("This data is passed to the command via stdin")229- );227+ .stdout(predicate::str::contains(228+ "This data is passed to the command via stdin",229+ ));230 }231 232 #[test]233-fn fails_if_invalid_stdin_data_file_provided(){233+fn fails_if_invalid_stdin_data_file_provided() {234 hyperfine()235 .arg("--runs=1")236 .arg("--stdin-data=example_stdin_data_invalid")237 .arg("--show-output")238 .arg("cat")239 .assert()240 .failure()241- .stderr(242- predicate::str::contains("File containing stdin data 'example_stdin_data_invalid' does not exist")243- );241+ .stderr(predicate::str::contains(242+ "File containing stdin data 'example_stdin_data_invalid' does not exist",243+ ));244 }245 246 #[test]247 fn returns_mean_time_in_correct_unit() {102 unmodified lines